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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to