Repository navigation
fix(array): preserve result nullability when simplifying and/or/zip - #10286
Merged
robert3005 merged 2 commits intoOct 4, 2026
Merged
robert3005 merged 2 commits into
robert3005 merged 2 commits into
Conversation
Literal simplification could turn a well-typed nullable expression into a non-nullable one: the and/or annihilator and identity rules returned a fresh non-nullable literal or a bare child, and the zip literal-mask rule returned the selected branch, none of them retaining the nullability binding had inferred. Coerce each simplified result back to the bound expression's dtype, so the optimized plan keeps the same result schema. The regression cases come from the issue. Fixes vortex-data#10009 Signed-off-by: jackylee-ch <[email protected]>
robert3005
reviewed
Oct 4, 2026
Build the annihilator literal and widen the identity child to the inferred result nullability inside each arm, instead of casting the whole result afterwards, as suggested in review. Signed-off-by: jackylee-ch <[email protected]>
robert3005
approved these changes
Oct 4, 2026
robert3005
enabled auto-merge (squash)
October 4, 2026 20:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Literal simplification could turn a well-typed nullable expression into a
non-nullable one. The and/or annihilator and identity rules returned a fresh
non-nullable bool literal or a bare child, and the zip literal-mask rule returned
the selected branch — none retaining the nullability that binding had inferred.
Optimizing e.g.
and(root(), lit(false))over a nullable root flippedbool?tobool, so the optimized plan advertised a narrower schema than the boundexpression.
Fix
Coerce each simplified result back to the bound expression's dtype, so the
optimized plan keeps the inferred result schema. The regression cases are the
ones from the issue.
Fixes #10009
AI assistance
Prepared with AI assistance; I have reviewed and verified the change.