[
https://issues.apache.org/jira/browse/TAJO-463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13858337#comment-13858337
]
Hudson commented on TAJO-463:
-----------------------------
SUCCESS: Integrated in Tajo-trunk-postcommit #648 (See
[https://builds.apache.org/job/Tajo-trunk-postcommit/648/])
TAJO-463: Throw PlanningException when Creating table with Partition exception
COLUMN. (DaeMyung Kang via hyunsik) (hyunsik:
https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=b574cf8c46bbcdf2601fc20ef149d08b0a88742f)
* CHANGES.txt
*
tajo-core/tajo-core-backend/src/test/java/org/apache/tajo/client/TestTajoClient.java
*
tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
*
tajo-core/tajo-core-backend/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java
> ProjectionPushDownRule incorrectly rewrite the output schema of StoreTableNode
> ------------------------------------------------------------------------------
>
> Key: TAJO-463
> URL: https://issues.apache.org/jira/browse/TAJO-463
> Project: Tajo
> Issue Type: Bug
> Components: planner/optimizer
> Reporter: Min Zhou
> Assignee: Hyunsik Choi
>
> When I was implementing CTAS on partitioned table, I ran into a schema
> problem if my target column names are different from select clause's output
> schema.
>
> {noformat}
> create table tbl (col1 int4, col2 int4, null_col int4) partition by
> column(key float8) as select l_orderkey as col1, l_partkey as col2,
> l_quantity as key from lineitem
> {noformat}
> After debugging, I found ProjectionPushDownRule would replace
> StoreTableNode's output schema with its child output schema.
> {noformat}
> @Override
> public LogicalNode visitStoreTable(PushDownContext context, LogicalPlan
> plan, StoreTableNode node,
> Stack<LogicalNode> stack) throws
> PlanningException {
> return pushDownCommonPost(context, node, stack);
> }
> private LogicalNode pushDownCommonPost(PushDownContext context, UnaryNode
> node, Stack<LogicalNode> stack)
> throws PlanningException {
> stack.push(node);
> LogicalNode child = visitChild(context, context.plan, node.getChild(),
> stack);
> stack.pop();
> node.setInSchema(child.getOutSchema());
> node.setOutSchema(child.getOutSchema()); // THIS LINE WILL REWRITE THE
> SCHEMA!
> if (node instanceof Projectable) {
> pushDownProjectablePost(context, node, isTopmostProjectable(stack));
> }
> return node;
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)