Github user jihoonson commented on the pull request:
https://github.com/apache/tajo/pull/402#issuecomment-82199826
Hi @ykrips thanks for your nice patch.
It looks good, but I have another suggestion even though it is not directly
related with this issue.
I think that ```union``` queries are popularly used for ETLs. So, I tested
the following query. (It is a CTAS statement of the case 1 of TAJO-1368.)
```
create table test using parquet as
select * from
(select c_custkey, c_nationkey from customer where c_nationkey < 0
union all
select c_custkey, c_nationkey from customer where c_nationkey > 0
) a
union all
select * from
(select c_custkey, c_nationkey from customer where c_nationkey < 0
union all
select c_custkey, c_nationkey from customer where c_nationkey > 0
) b
```
And, I found the following error.
```
2015-03-17 17:29:42,257 ERROR: org.apache.tajo.querymaster.QueryMasterTask
(startQuery(368)) -
java.lang.NullPointerException
at
org.apache.tajo.engine.planner.global.GlobalPlanner.buildNoPartitionedStorePlan(GlobalPlanner.java:1113)
at
org.apache.tajo.engine.planner.global.GlobalPlanner.buildStorePlan(GlobalPlanner.java:1037)
at
org.apache.tajo.engine.planner.global.GlobalPlanner.access$600(GlobalPlanner.java:68)
at
org.apache.tajo.engine.planner.global.GlobalPlanner$DistributedPlannerVisitor.visitCreateTable(GlobalPlanner.java:1570)
at
org.apache.tajo.engine.planner.global.GlobalPlanner$DistributedPlannerVisitor.visitCreateTable(GlobalPlanner.java:1141)
at
org.apache.tajo.plan.visitor.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:126)
at
org.apache.tajo.plan.visitor.BasicLogicalPlanVisitor.visitRoot(BasicLogicalPlanVisitor.java:151)
at
org.apache.tajo.engine.planner.global.GlobalPlanner$DistributedPlannerVisitor.visitRoot(GlobalPlanner.java:1146)
at
org.apache.tajo.engine.planner.global.GlobalPlanner$DistributedPlannerVisitor.visitRoot(GlobalPlanner.java:1141)
at
org.apache.tajo.plan.visitor.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:60)
at
org.apache.tajo.engine.planner.global.GlobalPlanner.build(GlobalPlanner.java:147)
at
org.apache.tajo.querymaster.QueryMasterTask.startQuery(QueryMasterTask.java:360)
at
org.apache.tajo.querymaster.QueryMasterTask.start(QueryMasterTask.java:175)
at
org.apache.tajo.querymaster.QueryMaster$QueryStartEventHandler.handle(QueryMaster.java:416)
at
org.apache.tajo.querymaster.QueryMaster$QueryStartEventHandler.handle(QueryMaster.java:403)
at
org.apache.hadoop.yarn.event.AsyncDispatcher.dispatch(AsyncDispatcher.java:173)
at
org.apache.hadoop.yarn.event.AsyncDispatcher$1.run(AsyncDispatcher.java:106)
at java.lang.Thread.run(Thread.java:745)
```
This error seems to be caused by misfunctioning of
```GlobalPlanner.hasUnionChild()```.
I think it would be great if you fix this bug, too.
---
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.
---