public LogicalNode handleCreateTableLike(PlanContext context, CreateTable expr, CreateTableNode createTableNode) throws TajoException { String parentTableName = expr.getLikeParentTableName(); if (CatalogUtil.isFQTableName(parentTableName) == false) { parentTableName = CatalogUtil.buildFQName(context.queryContext.get(SessionVars.CURRENT_DATABASE), parentTableName); } TableDesc baseTable = catalog.getTableDesc(parentTableName); if(baseTable == null) { throw new UndefinedTableException(parentTableName); } PartitionMethodDesc partitionDesc = baseTable.getPartitionMethod(); createTableNode.setTableSchema(baseTable.getSchema()); createTableNode.setPartitionMethod(partitionDesc); createTableNode.setDataFormat(CatalogUtil.getBackwardCompitableDataFormat(baseTable.getMeta().getDataFormat())); createTableNode.setOptions(baseTable.getMeta().getOptions()); createTableNode.setExternal(baseTable.isExternal()); if(baseTable.isExternal()) { createTableNode.setUri(baseTable.getUri()); } return createTableNode; }
public LogicalNode handleCreateTableLike(PlanContext context, CreateTable expr, CreateTableNode createTableNode) throws TajoException { String parentTableName = expr.getLikeParentTableName(); if (IdentifierUtil.isFQTableName(parentTableName) == false) { parentTableName = IdentifierUtil.buildFQName(context.queryContext.get(SessionVars.CURRENT_DATABASE), parentTableName); } TableDesc baseTable = catalog.getTableDesc(parentTableName); if(baseTable == null) { throw new UndefinedTableException(parentTableName); } PartitionMethodDesc partitionDesc = baseTable.getPartitionMethod(); createTableNode.setTableSchema(baseTable.getSchema()); createTableNode.setPartitionMethod(partitionDesc); createTableNode.setDataFormat(CatalogUtil.getBackwardCompitableDataFormat(baseTable.getMeta().getDataFormat())); createTableNode.setOptions(baseTable.getMeta().getPropertySet()); createTableNode.setExternal(baseTable.isExternal()); if(baseTable.isExternal()) { createTableNode.setUri(baseTable.getUri()); } return createTableNode; }
createTable.setPartitionMethod(new PartitionMethodDesc(storeTableNodeSpec.getPartitionMethod()));
createTable.setPartitionMethod(new PartitionMethodDesc(storeTableNodeSpec.getPartitionMethod()));
createTableNode.setPartitionMethod(getPartitionMethod(context, expr.getTableName(), expr.getPartitionMethod())); } else { throw ExceptionUtil.makeNotSupported(
createTableNode.setPartitionMethod(getPartitionMethod(context, expr.getTableName(), expr.getPartitionMethod())); } else { throw ExceptionUtil.makeNotSupported(