[branch-53] Fix FilterExec converting Absent column stats to Exact(NULL) (#20391)#20892
Open
alamb wants to merge 1 commit intoapache:branch-53from
Open
[branch-53] Fix FilterExec converting Absent column stats to Exact(NULL) (#20391)#20892alamb wants to merge 1 commit intoapache:branch-53from
alamb wants to merge 1 commit intoapache:branch-53from
Conversation
…20391) ## Which issue does this PR close? - Closes apache#20388. ## Rationale for this change `collect_new_statistics` in `FilterExec` wraps NULL interval bounds in `Precision::Exact`, converting what should be `Precision::Absent` column statistics into `Precision::Exact(ScalarValue::Int32(None))`. Downstream, `estimate_disjoint_inputs` treats these as real bounds and incorrectly concludes join inputs are disjoint, forcing Partitioned join mode and disabling dynamic filter pushdown for Parquet row group pruning. ## What changes are included in this PR? Single change to `collect_new_statistics` in `filter.rs`: check `is_null()` on interval bounds before wrapping in `Precision`, mapping NULL bounds back to `Absent`. ## Are these changes tested? Yes — includes a regression test (`test_filter_statistics_absent_columns_stay_absent`) that fails on current main and passes with the fix. ## Are there any user-facing changes? No API changes. Corrects statistics propagation for tables/views with absent column statistics. --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
26 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
53.0.0(Feb 2026 / Mar 2026) #19692FilterExec::collect_new_statisticsconverts Absent column stats to Exact(NULL), corrupting join cardinality estimation #20388 on branch-53This PR: