Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.8.0, 0.9.0
-
None
Description
The below query can cause the following error.
select
nation.n_nationkey as n_nationkey,
customer.c_name as c_name,
count(nation.n_nationkey) as cnt
from
nation inner join customer on n_nationkey = c_nationkey
group by
nation.n_nationkey,
customer.c_name
order by
n_nationkey, c_name;
Stack Trace: org.apache.tajo.engine.planner.PlanningException: Cannot expect a referenced relation: n_nationkey (INT4) at org.apache.tajo.engine.planner.logical.join.JoinGraph.guessRelationsFromJoinQual(JoinGraph.java:59) at org.apache.tajo.engine.planner.logical.join.JoinGraph.addJoin(JoinGraph.java:92) at org.apache.tajo.engine.planner.LogicalOptimizer$JoinGraphBuilder.visitJoin(LogicalOptimizer.java:165) at org.apache.tajo.engine.planner.LogicalOptimizer$JoinGraphBuilder.visitJoin(LogicalOptimizer.java:133) at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:81) at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitGroupBy(BasicLogicalPlanVisitor.java:176) at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:75) at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitSort(BasicLogicalPlanVisitor.java:158) at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:69) at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitProjection(BasicLogicalPlanVisitor.java:140) at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:63) at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitRoot(BasicLogicalPlanVisitor.java:130) at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:58) at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:45) at org.apache.tajo.engine.planner.LogicalOptimizer$JoinGraphBuilder.buildJoinGraph(LogicalOptimizer.java:148) at org.apache.tajo.engine.planner.LogicalOptimizer.optimizeJoinOrder(LogicalOptimizer.java:86) at org.apache.tajo.engine.planner.LogicalOptimizer.optimize(LogicalOptimizer.java:71) at org.apache.tajo.master.GlobalEngine.createLogicalPlan(GlobalEngine.java:260) at org.apache.tajo.master.GlobalEngine.executeQuery(GlobalEngine.java:138)