notashes commented on code in PR #20279:
URL: https://github.com/apache/datafusion/pull/20279#discussion_r2791269653


##########
datafusion/physical-plan/src/aggregates/mod.rs:
##########
@@ -1129,6 +1129,16 @@ impl AggregateExec {
             return;
         }
 
+        // Don't push the dynamic filter if the query includes aggregates like
+        // COUNT, SUM, AVG as they usually require all of the rows matching 
the WHERE clause
+        let has_non_minmax = self.aggr_expr.iter().any(|aggr_expr| {
+            let fun_name = aggr_expr.fun().name();
+            !fun_name.eq_ignore_ascii_case("min") && 
!fun_name.eq_ignore_ascii_case("max")

Review Comment:
   oh yes, that should do it! thanks for the review! 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to