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


##########
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:
   nit: We could skip checking volatile if it’s already unsupported.
   ```rust
                   let zip =
                       filter_predicates
                           .into_iter()
                           .zip(results)
                           .map(|(pred, mut res)| {
                               if !matches!(res, 
TableProviderFilterPushDown::Unsupported)
                                   && pred.is_volatile()
                               {
                                   // Do not push down predicate with volatile 
functions to scan
                                   res = 
TableProviderFilterPushDown::Unsupported
                               }
                               (pred, res)
                           });
   ```



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