duongcongtoai commented on code in PR #16186:
URL: https://github.com/apache/datafusion/pull/16186#discussion_r2106233488


##########
datafusion/optimizer/src/push_down_filter.rs:
##########
@@ -1089,7 +1089,11 @@ impl OptimizerRule for PushDownFilter {
                 let (volatile_filters, non_volatile_filters): (Vec<&Expr>, 
Vec<&Expr>) =
                     filter_predicates
                         .into_iter()
-                        .partition(|pred| pred.is_volatile());
+                        // TODO: subquery decorrelation sometimes cannot 
decorrelated all the expr
+                        // (i.e in the case of recursive subquery)
+                        // this function may accidentally pushdown the 
subquery expr as well
+                        // until then, we have to exclude these exprs here
+                        .partition(|pred| pred.is_volatile() || 
has_subquery(pred));

Review Comment:
   this is to satisfy the new test added in subquery.slt, else the predicate 
containing the scalar subquery will be accidentally pushed down and cause 
planning error



-- 
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: github-unsubscr...@datafusion.apache.org

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


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

Reply via email to