private static void buildPartitionClause(StringBuilder sb, TableDesc desc) { PartitionMethodDesc partitionDesc = desc.getPartitionMethod(); sb.append(" PARTITION BY "); sb.append(partitionDesc.getPartitionType().name()); // columns sb.append("("); String prefix = ""; for (Column column : partitionDesc.getExpressionSchema().toArray()) { sb.append(prefix).append(CatalogUtil.columnToDDLString(column)); prefix = ", "; } sb.append(")"); }
private static void buildPartitionClause(StringBuilder sb, TableDesc desc) { PartitionMethodDesc partitionDesc = desc.getPartitionMethod(); sb.append(" PARTITION BY "); sb.append(partitionDesc.getPartitionType().name()); // columns sb.append("("); String prefix = ""; for (Column column : partitionDesc.getExpressionSchema().toArray()) { sb.append(prefix).append(CatalogUtil.columnToDDLString(column)); prefix = ", "; } sb.append(")"); }
sb.append("Partitions: \n"); sb.append("type:").append(partition.getPartitionType().name()).append("\n");
pstmt.setString(2, table.getPartition().getPartitionType().name()); pstmt.setString(3, table.getPartition().getExpression()); pstmt.setBytes(4, table.getPartition().getExpressionSchema().toByteArray());
pstmt.setString(2, table.getPartition().getPartitionType().name()); pstmt.setString(3, table.getPartition().getExpression()); pstmt.setBytes(4, table.getPartition().getExpressionSchema().toByteArray());
sb.append("Partitions: \n"); sb.append("type:").append(partition.getPartitionType().name()).append("\n");
/** * It builds a distributed execution block for CTAS, InsertNode, and StoreTableNode. */ private ExecutionBlock buildStorePlan(GlobalPlanContext context, ExecutionBlock lastBlock, StoreTableNode currentNode) throws TajoException { if(currentNode.hasPartition()) { // if a target table is a partitioned table // Verify supported partition types PartitionMethodDesc partitionMethod = currentNode.getPartitionMethod(); if (partitionMethod.getPartitionType() != CatalogProtos.PartitionType.COLUMN) { throw new NotImplementedException("partition type '" + partitionMethod.getPartitionType().name() + "'"); } if (hasUnionChild(currentNode)) { // if it has union children return buildShuffleAndStorePlanToPartitionedTableWithUnion(context, currentNode, lastBlock); } else { // otherwise return buildShuffleAndStorePlanToPartitionedTable(context, currentNode, lastBlock); } } else { // if result table is not a partitioned table, directly store it return buildNoPartitionedStorePlan(context, currentNode, lastBlock); } }
/** * It builds a distributed execution block for CTAS, InsertNode, and StoreTableNode. */ private ExecutionBlock buildStorePlan(GlobalPlanContext context, ExecutionBlock lastBlock, StoreTableNode currentNode) throws TajoException { if(currentNode.hasPartition()) { // if a target table is a partitioned table // Verify supported partition types PartitionMethodDesc partitionMethod = currentNode.getPartitionMethod(); if (partitionMethod.getPartitionType() != CatalogProtos.PartitionType.COLUMN) { throw new NotImplementedException("partition type '" + partitionMethod.getPartitionType().name() + "'"); } if (hasUnionChild(currentNode)) { // if it has union children return buildShuffleAndStorePlanToPartitionedTableWithUnion(context, currentNode, lastBlock); } else { // otherwise return buildShuffleAndStorePlanToPartitionedTable(context, currentNode, lastBlock); } } else { // if result table is not a partitioned table, directly store it return buildNoPartitionedStorePlan(context, currentNode, lastBlock); } }