Skip to content

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

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

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

Conversation

…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
`Closes apache#123` indicates that this PR will close issue apache#123.
-->

- Closes apache#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-actions github-actions bot added core Core DataFusion crate physical-plan Changes to the physical-plan crate labels Mar 11, 2026
@alamb alamb 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
Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

Thanks @alamb

Copy link
Contributor

@haohuaijin haohuaijin left a comment

Choose a reason for hiding this comment

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

Thank you @alamb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants