suibianwanwank commented on code in PR #4574:
URL: https://github.com/apache/calcite/pull/4574#discussion_r2422371454
##########
core/src/main/java/org/apache/calcite/rel/rules/SubQueryRemoveRule.java:
##########
@@ -895,12 +895,8 @@ private static void matchFilter(SubQueryRemoveRule rule,
LogicVisitor.find(RelOptUtil.Logic.TRUE, ImmutableList.of(c), e);
final Set<CorrelationId> variablesSet =
RelOptUtil.getVariablesUsed(e.rel);
- // Filter without variables could be handled before this change, we do
not want
- // to break it yet for compatibility reason.
- if (!filterVariablesSet.isEmpty()) {
- // Only consider the correlated variables which originated from this
sub-query level.
- variablesSet.retainAll(filterVariablesSet);
- }
+ // Only consider the correlated variables which originated from this
sub-query level.
Review Comment:
Got it — that makes sense.
Btw, although getVariablesSet() returns a collection, I think a single
CorrelateId should generally be enough for a given RelNode, even if it involves
multiple subqueries or correlated variables.
--
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]