@Override public LogicalNode visitAlterTable(PlanContext context, Stack<Expr> stack, AlterTable alterTable) { AlterTableNode alterTableNode = context.queryBlock.getNodeFromExpr(alterTable); alterTableNode.setTableName(alterTable.getTableName()); alterTableNode.setNewTableName(alterTable.getNewTableName()); alterTableNode.setColumnName(alterTable.getColumnName()); alterTableNode.setNewColumnName(alterTable.getNewColumnName()); alterTableNode.setProperties(new KeyValueSet(alterTable.getParams())); List<String> propertyKeys = alterTable.getUnsetPropertyKeys(); if (null != propertyKeys) { alterTableNode.setUnsetPropertyKeys(propertyKeys.toArray(new String[propertyKeys.size()])); } if (null != alterTable.getAddNewColumn()) { alterTableNode.setAddNewColumn(convertColumn(alterTable.getAddNewColumn())); } if (alterTable.getColumns() != null) { alterTableNode.setPartitionColumns(convertColumnsToStrings(alterTable.getColumns())); } if (alterTable.getValues() != null) { alterTableNode.setPartitionValues(convertExprsToPartitionTableStringValues(alterTable.getValues())); } if (alterTable.getLocation() != null) { alterTableNode.setLocation(alterTable.getLocation()); } alterTableNode.setPurge(alterTable.isPurge()); alterTableNode.setIfNotExists(alterTable.isIfNotExists()); alterTableNode.setIfExists(alterTable.isIfExists()); alterTableNode.setAlterTableOpType(alterTable.getAlterTableOpType()); return alterTableNode; }
@Override public LogicalNode visitAlterTable(PlanContext context, Stack<Expr> stack, AlterTable alterTable) { AlterTableNode alterTableNode = context.queryBlock.getNodeFromExpr(alterTable); alterTableNode.setTableName(alterTable.getTableName()); alterTableNode.setNewTableName(alterTable.getNewTableName()); alterTableNode.setColumnName(alterTable.getColumnName()); alterTableNode.setNewColumnName(alterTable.getNewColumnName()); alterTableNode.setProperties(new KeyValueSet(alterTable.getParams())); if (null != alterTable.getAddNewColumn()) { alterTableNode.setAddNewColumn(convertColumn(alterTable.getAddNewColumn())); } if (alterTable.getColumns() != null) { alterTableNode.setPartitionColumns(convertColumnsToStrings(alterTable.getColumns())); } if (alterTable.getValues() != null) { alterTableNode.setPartitionValues(convertExprsToPartitionTableStringValues(alterTable.getValues())); } if (alterTable.getLocation() != null) { alterTableNode.setLocation(alterTable.getLocation()); } alterTableNode.setPurge(alterTable.isPurge()); alterTableNode.setIfNotExists(alterTable.isIfNotExists()); alterTableNode.setIfExists(alterTable.isIfExists()); alterTableNode.setAlterTableOpType(alterTable.getAlterTableOpType()); return alterTableNode; }