Skip to content

[branch-53] fix: interval analysis error when have two filterexec that inner filter proves zero selectivity (#20743) - #20882

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

[branch-53] fix: interval analysis error when have two filterexec that inner filter proves zero selectivity (#20743)#20882
alamb merged 1 commit into
apache:branch-53from
alamb:alamb/backport_20743_branch53

Conversation

@alamb

Copy link
Copy Markdown
Contributor

…er proves zero selectivity (apache#20743)
## 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
`Closesapache#123` indicates that this PR will close issue apache#123.
-->
- Closesapache#20742
## Rationale for this change
- see apache#20742
## What changes are included in this PR?
In `collect_new_statistics`, when a filter proves no rows can match, use
a typed null (e.g., ScalarValue::Int32(None)) instead of untyped
ScalarValue::Null for column min/max/sum values. The column's data type
is looked up from the schema so that downstream interval analysis can
still intersect intervals of the same type.
## Are these changes tested?
add one test case
## 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.
-->
@github-actionsgithub-actionsBot added core Core DataFusion crate physical-plan Changes to the physical-plan crate labels Mar 11, 2026
@alambalamb changed the title "[branch-53] fix: interval analysis error when have two filterexec that inner filter proves zero selectivity (#20743)"[branch-53] fix: interval analysis error when have two filterexec that inner filter proves zero selectivity (#20743)Mar 11, 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

@haohuaijinhaohuaijin 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.

Thank you @alamb

@alamb
alamb merged commit 76751f1 into apache:branch-53Mar 12, 2026
33 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coreCore DataFusion cratephysical-planChanges to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@alamb@comphead@haohuaijin