silundong commented on code in PR #4840:
URL: https://github.com/apache/calcite/pull/4840#discussion_r3090468785


##########
core/src/main/java/org/apache/calcite/rel/rules/FilterJoinRule.java:
##########
@@ -198,14 +202,42 @@ protected void perform(RelOptRuleCall call, @Nullable 
Filter filter,
       return;
     }
 
+    // Collect the correlation variables (introduced via sub-queries) 
referenced
+    // by each bucket of predicates after classifyFilters has decided where 
every
+    // conjunct lives. The buckets are needed to (a) plumb variablesSet onto 
the
+    // newly-created child Filters and (b) recompute the join's own 
variablesSet
+    // without dropping ids that the surviving join condition still references.
+    final Set<CorrelationId> leftVariablesSet = new LinkedHashSet<>();

Review Comment:
   The modification to `RelOptUtil` in this PR already ensures that correlated 
subqueries in the ON condition will not be pushed down, so the `variablesSet` 
of the Join will remain unchanged, and the `variablesSet` of any new Filter 
produced by the pushdown will necessarily be empty. Therefore, `FilterJoinRule` 
does not require any additional changes, and consequently, the new copy method 
is also unnecessary in this PR (moreover, it would be a breaking change). You 
can open a new Jira ticket to discuss whether a new copy method should be added 
to Join.



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