private SchemaLegacy addColumn(String name, org.apache.tajo.type.Type type) { String normalized = name; if(fieldsByQualifiedName.containsKey(normalized)) { throw new TajoRuntimeException(new DuplicateColumnException(normalized)); } Column newCol = new Column(normalized, type); fields.add(newCol); fieldsByQualifiedName.put(newCol.getQualifiedName(), fields.size() - 1); List<Integer> inputList = new ArrayList<>(); inputList.add(fields.size() - 1); fieldsByName.put(newCol.getSimpleName(), inputList); return this; }
public synchronized Schema addColumn(String name, TypeDesc typeDesc) { String normalized = name; if(fieldsByQualifiedName.containsKey(normalized)) { throw new TajoRuntimeException(new DuplicateColumnException(normalized)); } Column newCol = new Column(normalized, typeDesc); fields.add(newCol); fieldsByQualifiedName.put(newCol.getQualifiedName(), fields.size() - 1); fieldsByName.put(newCol.getSimpleName(), TUtil.newList(fields.size() - 1)); return this; }
throw new DuplicateColumnException(columnProto.getName());
throw new DuplicateColumnException(evalNode.toString());
throw new DuplicateColumnException(columnProto.getName());
throw new DuplicateColumnException(evalNode.toString());
case RENAME_COLUMN: if (existColumn(databaseName,tableName, alterTableDescProto.getAlterColumnName().getNewColumnName())) { throw new DuplicateColumnException(alterTableDescProto.getAlterColumnName().getNewColumnName()); case ADD_COLUMN: if (existColumn(databaseName,tableName, alterTableDescProto.getAddColumn().getName())) { throw new DuplicateColumnException(alterTableDescProto.getAddColumn().getName());
case RENAME_COLUMN: if (ensureColumnExistance(qualifiedName, alterTable.getNewColumnName())) { throw new DuplicateColumnException(alterTable.getNewColumnName()); case ADD_COLUMN: if (ensureColumnExistance(qualifiedName, alterTable.getAddNewColumn().getSimpleName())) { throw new DuplicateColumnException(alterTable.getAddNewColumn().getSimpleName());
case RENAME_COLUMN: if (ensureColumnExistance(qualifiedName, alterTable.getNewColumnName())) { throw new DuplicateColumnException(alterTable.getNewColumnName()); case ADD_COLUMN: if (ensureColumnExistance(qualifiedName, alterTable.getAddNewColumn().getSimpleName())) { throw new DuplicateColumnException(alterTable.getAddNewColumn().getSimpleName());
case RENAME_COLUMN: if (existColumn(tableId, alterTableDescProto.getAlterColumnName().getNewColumnName())) { throw new DuplicateColumnException(alterTableDescProto.getAlterColumnName().getNewColumnName()); case ADD_COLUMN: if (existColumn(tableId, alterTableDescProto.getAddColumn().getName())) { throw new DuplicateColumnException(alterTableDescProto.getAddColumn().getName());
case RENAME_COLUMN: if (existColumn(tableId, alterTableDescProto.getAlterColumnName().getNewColumnName())) { throw new DuplicateColumnException(alterTableDescProto.getAlterColumnName().getNewColumnName()); case ADD_COLUMN: if (existColumn(tableId, alterTableDescProto.getAddColumn().getName())) { throw new DuplicateColumnException(alterTableDescProto.getAddColumn().getName());