Skip to content

fix(expr): Fold unary predicate to AlwaysFalse / AlwaysTrue when the field and its ancestors are required - #3125

Open
hsiang-c wants to merge 4 commits into
apache:mainfrom
hsiang-c:is_null_check
Open

fix(expr): Fold unary predicate to AlwaysFalse / AlwaysTrue when the field and its ancestors are required#3125
hsiang-c wants to merge 4 commits into
apache:mainfrom
hsiang-c:is_null_check

Conversation

@hsiang-c

@hsiang-c hsiang-c commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

What changes are included in this PR?

  • In predicate.rs, for IsNull and NotNull unary predicates, fold to AlwaysFalse and AlwaysTrue respectively only when all the field's ancestors are required. Otherwise, we might either return nothing or unexpected rows when the projection is pushed down.

Are these changes tested?

Yes, unit tests.

AI Disclosure

Yes, I use AI to scaffold most of the test cases and verify the implementation against Iceberg Java.

@hsiang-c
hsiang-c marked this pull request as ready for review September 1, 2026 23:41
@hsiang-c

hsiang-c commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@CTTY Please take a look for me when you have time, thanks a lot!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Required fields nested within optional structs can produce nulls if the parent struct is null and fails is_null / is_not_null evaluation

1 participant