Source:
<code>protected PTable addDynamicColumns(List<ColumnDef> dynColumns,PTable theTable)throws AmbiguousColumnException,ColumnFamilyNotFoundException{ List<ColumnDef> acceptedColumns = new ArrayList<ColumnDef>(); if(dynColumns!=null && !dynColumns.isEmpty()) { List<PColumn> allcolumns = new ArrayList<PColumn>(); allcolumns.addAll(theTable.getColumns()); int position = allcolumns.size(); PColumn column = null; for(ColumnDef cdef:dynColumns){ column = theTable.hasColumn(cdef.getColumnDefName().getColumnName().getName()); if(column==null){ acceptedColumns.add(cdef); <START> }else if(!column.getDataType().equals(cdef.getDataType())){ <END> throw new AmbiguousColumnException(cdef.getColumnDefName().getColumnName().getName()); }else{ if(cdef.getColumnDefName().getFamilyName() != null){ theTable.getColumnFamily(cdef.getColumnDefName().getFamilyName().getName()); }else{ theTable.getColumnFamily(QueryConstants.DEFAULT_COLUMN_FAMILY_NAME.toString()); } } } for(ColumnDef addDef:acceptedColumns){ PName familyName = null; if (addDef.getColumnDefName().getFamilyName() != null) { familyName = new PNameImpl(addDef.getColumnDefName().getFamilyName().getName()); }else{ familyName = QueryConstants.DEFAULT_COLUMN_FAMILY_NAME; } PName Name = new PNameImpl(addDef.getColumnDefName().getColumnName().getName()); allcolumns.add(new PColumnImpl(Name,familyName,addDef.getDataType(), addDef.getMaxLength(), addDef.getScale(),addDef.isNull(), position, addDef.getColumnModifier())); position++; } theTable = new PTableImpl(theTable.getName(), theTable.getType(),theTable.getTimeStamp(), theTable.getSequenceNumber(),theTable.getPKName(), theTable.getBucketNum(), allcolumns); } return theTable; }</code><technical_language>If theTable.getColumn(name), this throw AmbiguousColumnException for you, get rid of this else if</technical_language>

Target:
protected PTable addDynamicColumns(List<ColumnDef> dynColumns, PTable theTable) throws AmbiguousColumnException, ColumnFamilyNotFoundException { List<ColumnDef> acceptedColumns = new ArrayList<ColumnDef>(); if (!dynColumns.isEmpty()) { List<PColumn> allcolumns = new ArrayList<PColumn>(); allcolumns.addAll(theTable.getColumns()); int position = allcolumns.size(); PColumn column = null; for (ColumnDef cdef : dynColumns) { try { column = theTable.getColumn(cdef.getColumnDefName().getColumnName().getName()); if (!column.getDataType().equals(cdef.getDataType())) { throw new AmbiguousColumnException(cdef.getColumnDefName().getColumnName().getName()); } } catch (ColumnNotFoundException e) { String FamilyName = cdef.getColumnDefName().getFamilyName()!=null?cdef.getColumnDefName().getFamilyName().getName():QueryConstants.DEFAULT_COLUMN_FAMILY; theTable.getColumnFamily(FamilyName); acceptedColumns.add(cdef); } } for (ColumnDef addDef : acceptedColumns) { PName familyName = QueryConstants.DEFAULT_COLUMN_FAMILY_NAME; PName Name = new PNameImpl(addDef.getColumnDefName().getColumnName().getName()); if (addDef.getColumnDefName().getFamilyName() != null) { familyName = new PNameImpl(addDef.getColumnDefName().getFamilyName().getName()); } allcolumns.add(new PColumnImpl(Name, familyName, addDef.getDataType(), addDef.getMaxLength(), addDef.getScale(), addDef.isNull(), position, addDef.getColumnModifier())); position++; } theTable = new PTableImpl(theTable.getName(), theTable.getType(), theTable.getTimeStamp(), theTable.getSequenceNumber(), theTable.getPKName(), theTable.getBucketNum(), allcolumns); } return theTable; }