Skip to content

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

Open
alamb wants to merge 1 commit intoapache:branch-53from
alamb:alamb/backport_20391_branch53
Open

[branch-53] Fix FilterExec converting Absent column stats to Exact(NULL) (#20391)#20892
alamb wants to merge 1 commit intoapache:branch-53from
alamb:alamb/backport_20391_branch53

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>
@github-actions github-actions bot added the physical-plan Changes to the physical-plan crate label Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants