NobiGo commented on code in PR #4226:
URL: https://github.com/apache/calcite/pull/4226#discussion_r1982423903


##########
core/src/main/java/org/apache/calcite/rex/RexUtil.java:
##########
@@ -2826,6 +2826,21 @@ private CorrelationFinder() {
     @Override public Void visitCorrelVariable(RexCorrelVariable var) {
       throw Util.FoundOne.NULL;
     }
+
+    @Override public Void visitSubQuery(RexSubQuery subQuery) {
+      if (!deep) {
+        return null;
+      }
+
+      for (RexNode operand : subQuery.operands) {
+        operand.accept(this);
+      }
+
+      if (!RelOptUtil.getVariablesUsed(subQuery.rel).isEmpty()) {
+        throw Util.FoundOne.NULL;

Review Comment:
   `RelOptUtil.getVariablesUsed` can collect all the variables used in the 
Filter operator, including those from the input plan and the filter's 
Condition. Here, we only need to focus on the variables within the Condition.
   `RelOptUtil.notContainsCorrelation` determines whether a specific 
correlation is included. Here, we need to check whether a correlation exists.
   Did I misunderstand something?



-- 
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]

Reply via email to