You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/09/28 00:45:03 UTC

(datafusion) branch gh-readonly-queue/main/pr-25768-afaa4bc5757b35ed94d6b3c005c842b58e32f48c created (now 1bd2ad3efe)

This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a change to branch gh-readonly-queue/main/pr-25768-afaa4bc5757b35ed94d6b3c005c842b58e32f48c
in repository https://gitbox.apache.org/repos/asf/datafusion.git


      at 1bd2ad3efe refactor: simplify filter pushdown volatility check (#25768)

This branch includes the following new commits:

     new 1bd2ad3efe refactor: simplify filter pushdown volatility check (#25768)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org


(datafusion) 01/01: refactor: simplify filter pushdown volatility check (#25768)

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-25768-afaa4bc5757b35ed94d6b3c005c842b58e32f48c
in repository https://gitbox.apache.org/repos/asf/datafusion.git

commit 1bd2ad3efe70829c9524c5218aff8b4f2a93edbe
Author: Yongting You <20...@gmail.com>
AuthorDate: Mon Sep 28 00:44:38 2026 +0000

    refactor: simplify filter pushdown volatility check (#25768)
    
    ## Which issue does this PR close?
    
    <!--
    We generally require a GitHub issue to be filed for all bug fixes and
    enhancements and this helps us generate change logs for our releases.
    You can link an issue to this PR using the GitHub syntax. For example
    `Closes #123` indicates that this PR will close issue #123.
    -->
    
    - Closes #.
    
    ## Rationale for this change
    
    <!--
    Why are you proposing this change? If this is already explained clearly
    in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand
    your changes and offer better suggestions for fixes.
    
    Please explain the problem you are trying to solve in terms of the
    user-visible
    behavior, rather than the implementation.
    
    For example, "The code in `foo.rs` doesn't handle nulls" is a symptom of
    the
    implementation. "COUNT(DISTINCT) returns wrong results when the column
    contains
    nulls" is the user-visible problem.
    -->
    `is_volatile` already have inner traversal for nested expression, here
    it tries re-implement it externally.
    
    ## What changes are included in this PR?
    
    <!--
    There is no need to duplicate the description in the issue here, but it
    is sometimes worth providing a summary of the individual changes in this
    PR.
    -->
    
    ## What is the testing strategy for this PR?
    
    <!--
    We typically require tests for all PRs in order to:
    1. Prevent the code from being accidentally broken by subsequent changes
    2. Serve as another way to document the expected behavior of the code
    
    Briefly describe how this PR is tested, and point to the specific tests
    you added. For example: 'This new feature is covered by the
    `sqllogictest` cases added in `foo.slt`'.
    
    If this PR does not add tests, explain why. For example, if the change
    is already covered by existing tests, please mention it.
    
    You should also check the `codecov` bot reply on this PR to confirm the
    changed code is exercised.
    -->
    
    ## Are there any user-facing changes?
    
    <!--
    If there are user-facing changes then we may require documentation to be
    updated before approving the PR.
    
    If there are any breaking changes to public APIs, please add the `api
    change` label.
    -->
---
 datafusion/physical-optimizer/src/filter_pushdown.rs | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/datafusion/physical-optimizer/src/filter_pushdown.rs b/datafusion/physical-optimizer/src/filter_pushdown.rs
index 18fe151000..8beadf5d04 100644
--- a/datafusion/physical-optimizer/src/filter_pushdown.rs
+++ b/datafusion/physical-optimizer/src/filter_pushdown.rs
@@ -35,7 +35,6 @@ use std::sync::Arc;
 
 use crate::PhysicalOptimizerRule;
 
-use datafusion_common::tree_node::{TreeNode, TreeNodeRecursion};
 use datafusion_common::{Result, assert_eq_or_internal_err, config::ConfigOptions};
 use datafusion_physical_expr::PhysicalExpr;
 use datafusion_physical_expr_common::physical_expr::is_volatile;
@@ -706,17 +705,7 @@ impl<T: Clone> FilteredVec<T> {
 }
 
 fn allow_pushdown_for_expr(expr: &Arc<dyn PhysicalExpr>) -> bool {
-    let mut allow_pushdown = true;
-    expr.apply(|e| {
-        allow_pushdown = allow_pushdown && !is_volatile(e);
-        if allow_pushdown {
-            Ok(TreeNodeRecursion::Continue)
-        } else {
-            Ok(TreeNodeRecursion::Stop)
-        }
-    })
-    .expect("Infallible traversal of PhysicalExpr tree failed");
-    allow_pushdown
+    !is_volatile(expr)
 }
 
 #[cfg(test)]


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org