zabetak commented on code in PR #5312:
URL: https://github.com/apache/hive/pull/5312#discussion_r1684086424
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveCalciteUtil.java:
##########
@@ -109,6 +110,25 @@ public static boolean
validateASTForUnsupportedTokens(ASTNode ast) {
}
}
+ public static boolean requiresCBO(Tree node) {
+ switch (node.getType()) {
+ // Hive can't support the following features without CBO
+ case HiveParser.TOK_EXCEPTALL:
+ case HiveParser.TOK_EXCEPTDISTINCT:
+ case HiveParser.TOK_INTERSECTALL:
+ case HiveParser.TOK_INTERSECTDISTINCT:
+ case HiveParser.TOK_QUALIFY:
+ return true;
+ default:
+ for (int i = 0; i < node.getChildCount(); i++) {
+ if (requiresCBO(node.getChild(i))) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
Review Comment:
For the properties suggestion, I was thinking something similar to the
existing design:
```
QueryProperties#hasIntersect
QueryProperties#hasExcept
QueryProperties#hasQualify
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]