jayzhan211 commented on code in PR #13475:
URL: https://github.com/apache/datafusion/pull/13475#discussion_r1849437818


##########
datafusion/optimizer/src/push_down_filter.rs:
##########
@@ -998,7 +998,19 @@ impl OptimizerRule for PushDownFilter {
                         filter_predicates.len());
                 }
 
-                let zip = filter_predicates.into_iter().zip(results);
+                let zip =
+                    filter_predicates
+                        .into_iter()
+                        .zip(results)
+                        .map(|(expr, res)| {
+                            let filter_pushdown_type = if expr.is_volatile() {

Review Comment:
   If there is possible that any table source can support volatile function 
then this checking should happen in `supports_filters_pushdown`.
   
   Otherwise, we should check `is_volatile` before `supports_filters_pushdown`, 
so those table source don't need to care about whether the function is volatile 
or not.
   
   Given that volatile has no deterministic result, I think it doesn't make 
sense to pushdown filter with those function, therefore I think we can check 
volatility beforehand



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