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


##########
core/src/main/java/org/apache/calcite/rel/rules/FilterProjectTransposeRule.java:
##########
@@ -213,7 +213,8 @@ protected FilterProjectTransposeRule(
   public interface Config extends RelRule.Config {
     Config DEFAULT = ImmutableFilterProjectTransposeRule.Config.of()
         .withOperandFor(Filter.class,
-            f -> !RexUtil.containsCorrelation(f.getCondition()),
+            f -> !RexUtil.containsCorrelation(f.getCondition())
+                && !RexUtil.SubQueryFinder.containsSubQuery(f),

Review Comment:
   Currently, The rule can't push down uncorrelated sub-queries either, because 
this can be achieved by removing the sub-query through other plans. Even if the 
sub-query is not removed, the subsequent plans can't be pushed down and will 
still be fine. 
   Correlated sub-queries definitely cannot be pushed down. If pushed down, 
problems will occur in the subsequent plans. Therefore, here I did not 
differentiate whether the specific sub-queries contain correlation or not.



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