Github user hyunsik commented on a diff in the pull request:
https://github.com/apache/tajo/pull/357#discussion_r24142323
--- Diff:
tajo-core/src/main/java/org/apache/tajo/engine/planner/PhysicalPlannerImpl.java
---
@@ -854,6 +855,14 @@ private PhysicalExec
createSortBasedColumnPartitionStorePlan(TaskAttemptContext
sortSpecs[i++] = new
SortSpec(insertNode.getProjectedSchema().getColumn(id), true, false);
}
}
+ } else if (storeTableNode.getType() == NodeType.CREATE_TABLE) {
+ int i = 0;
+ for (int j = 0; j < partitionKeyColumns.length; j++) {
+ int id = storeTableNode.getOutSchema().getColumns().size() + j;
--- End diff --
In 'CREATE TABLE', it is to hard to use qualified names of partition keys.
CreateTableNode's in/out schema only contains physically stored columns and
does not contain logical columns (i.e., partition key columns). The way
described in the patch will work correctly.
But, since this way is not intuitive, we need to refactor CreateTableNode
and InsertTableNode to provide a better way to access physical columns
corresponding to partition keys.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---