Tiancheng-Xu opened a new pull request, #26288: URL: https://github.com/apache/datafusion/pull/26288
## Which issue does this PR close? Closes #26267. ## Rationale for this change A filter on a projected volatile value can evaluate the expression again after physical filter pushdown. For example, a filter on `x` in `SELECT random() AS x` can use a different sample from the returned `x`, so rows can fail their own predicate or disappear from a tautology. ## What changes are included in this PR? Check the rewritten predicate for volatility before pushing it through `ProjectionExec`. Keep unsupported predicates in their original parent coordinates, above the projection. Independently immutable predicates and computed immutable projections still support pushdown. This is independent of the PhysicalFilter API prototype in #25760 and the logical CTE work in #26275. Add three scoped Clippy allowances for existing borrowed `Expr` partition-key sets. Rust 1.99 flags Arrow's interior-mutable reservation accounting, which does not change the expression values used for hashing or equality. Clean main produces the same three diagnostics; no optimizer algorithm changes are included in these allowances. ## What is the testing strategy for this PR? Extend `parquet_filter_pushdown.slt` with deterministic plans and returned-value invariants, covering pushdown enabled/disabled, nested volatile expressions, mixed predicates, and immutable controls. Before the fix, six cases fail, including 759 instead of 1,000 rows for a tautology and 82 returned values violating their filter. The focused file and 51 projection unit tests pass with the fix. Full-feature Clippy also passes. The extended workspace tests pass (12,598 tests; all 534 SQL test files), along with 110 CLI tests, 189 core doctests, all-feature Clippy, and the complete lint suite. Forward and reverse CI-profile planning microbenchmarks detect no statistically significant change. They run on a shared macOS machine with an unoptimized build and do not establish query-runtime performance. ## Are there any user-facing changes? Filters on volatile projections retain the projected value's semantics. There are no public API changes. This addresses static projection predicates; a separate scan-embedded Post dynamic-filter path has not been runtime-tested here. -- 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]
