HIVE-29612: LATERAL VIEW OUTER doesn't work with CBO enabled#6482
HIVE-29612: LATERAL VIEW OUTER doesn't work with CBO enabled#6482soumyakanti3578 wants to merge 3 commits into
Conversation
| } else if (SemanticAnalyzer.isJoinToken(left)) { | ||
| leftRel = genJoinLogicalPlan(qb, left, aliasToRel, outerNameToPosMap, outerRR); | ||
| } else if (left.getToken().getType() == HiveParser.TOK_LATERAL_VIEW) { | ||
| } else if (left.getToken().getType() == HiveParser.TOK_LATERAL_VIEW |
There was a problem hiding this comment.
nit: perhaps we could refactor all these type == HiveParser.TOK_LATERAL_VIEW || type == HiveParser.TOK_LATERAL_VIEW_OUTER into a single helper method?
| if (!TABLE_ALIAS_TOKEN_TYPES.contains(next.getToken().getType()) && | ||
| HiveParser.TOK_LATERAL_VIEW != next.getToken().getType()) { | ||
| throw new SemanticException(ASTErrorUtils.getMsg( | ||
| HiveParser.TOK_LATERAL_VIEW != next.getToken().getType() && |
There was a problem hiding this comment.
I guess now this could also be rewritten using the new helper
... && !isASTNodeLateralViewOrOuter(next)
There was a problem hiding this comment.
Yes, thanks for catching this! I have refactored this and also other places in SemanticAnalyzer.
|
rubenada
left a comment
There was a problem hiding this comment.
Not super familiar with this code (yet), but changes LGTM.
The only detail is the new boolean flag HiveTableFunctionScan#outer, which seems a bit ad-hoc. I wonder if in the future we'd need for it to be something more "generic" (like an enum), although atm this seems a bit overengineering if we only need to represent one value.



What changes were proposed in this pull request?
Support
LATERAL VIEW OUTERwith CBO enabledWhy are the changes needed?
https://issues.apache.org/jira/browse/HIVE-29612
Does this PR introduce any user-facing change?
No
How was this patch tested?