Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
The query contains INTERSECT ALL operator and one of its operands has an OUTER JOIN like:
SELECT ... FROM t1 RIGHT OUTER JOIN t2 ON ... INTERSECT ALL SELECT ...
In this case both AST trees (before and after calcite) has a TOK_INTERSECTALL node and it is not handled
when generating the plan in
org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java private Operator genPlan(QB parent, QBExpr qbexpr) throws SemanticException { if (qbexpr.getOpcode() == QBExpr.Opcode.NULLOP) { boolean skipAmbiguityCheck = viewSelect == null && parent.isTopLevelSelectStarQuery(); return genPlan(qbexpr.getQB(), skipAmbiguityCheck); } if (qbexpr.getOpcode() == QBExpr.Opcode.UNION) { Operator qbexpr1Ops = genPlan(parent, qbexpr.getQBExpr1()); Operator qbexpr2Ops = genPlan(parent, qbexpr.getQBExpr2()); return genUnionPlan(qbexpr.getAlias(), qbexpr.getQBExpr1().getAlias(), qbexpr1Ops, qbexpr.getQBExpr2().getAlias(), qbexpr2Ops); } return null; }