Skip to content

[branch-53] Fix FilterExec converting Absent column stats to Exact(NULL) (#20391) - #20892

Merged
comphead merged 1 commit into
apache:branch-53from
alamb:alamb/backport_20391_branch53
Mar 12, 2026
Merged

[branch-53] Fix FilterExec converting Absent column stats to Exact(NULL) (#20391)#20892
comphead merged 1 commit into
apache:branch-53from
alamb:alamb/backport_20391_branch53

Conversation

@alamb

Copy link
Copy Markdown
Contributor

…20391)
## Which issue does this PR close?
- Closesapache#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>
@github-actionsgithub-actionsBot added the physical-plan Changes to the physical-plan crate label Mar 12, 2026

@compheadcomphead left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alamb

@comphead

Copy link
Copy Markdown
Contributor

waiting for extended tests CI

@comphead
comphead merged commit ed25cc2 into apache:branch-53Mar 12, 2026
35 of 36 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-planChanges to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@alamb@comphead@fwojciec