Skip to content

fix: interval analysis error when have two filterexec that inner filter proves zero selectirity#20743

Open
haohuaijin wants to merge 2 commits intoapache:mainfrom
haohuaijin:fix-statistics-panic
Open

fix: interval analysis error when have two filterexec that inner filter proves zero selectirity#20743
haohuaijin wants to merge 2 commits intoapache:mainfrom
haohuaijin:fix-statistics-panic

Conversation

@haohuaijin
Copy link
Contributor

@haohuaijin haohuaijin commented Mar 6, 2026

Which issue does this PR close?

Rationale for this change

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?

@github-actions github-actions bot added the physical-plan Changes to the physical-plan crate label Mar 6, 2026
@haohuaijin haohuaijin changed the title fix: interval analysis panic when have two filterexec that inner filter proves zero selectirity fix: interval analysis error when have two filterexec that inner filter proves zero selectirity Mar 6, 2026
@github-actions github-actions bot added the core Core DataFusion crate label Mar 6, 2026
Copy link
Contributor

@jonathanc-n jonathanc-n left a comment

Choose a reason for hiding this comment

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

Very nice, makes sense to me!

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.

interval analysis error when have two filterexec that inner filter proves zero selectirity

2 participants