Repository navigation
Core: Bound IsNull and NotNull on the full field path - #4513
Open
Anurag-S1ngh wants to merge 1 commit into
Open
Anurag-S1ngh wants to merge 1 commit into
Anurag-S1ngh wants to merge 1 commit into
Conversation
IsNull and NotNull folded a required field to AlwaysFalse and AlwaysTrue using only the leaf field. A required leaf under an optional struct can still be absent, which made plan_files drop matching files. Fold at bind time only when the field and every ancestor are required.
This branch has not been deployed
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.
Rationale for this change
Closes #4067.
IsNullandNotNullfolded a required field toAlwaysFalseandAlwaysTrueusing only the leaf field'srequiredflag. A required leaf can still be absent when an ancestor struct is null, so a scan could prune every file and return no rows.The fold now happens at bind time and only when the field and every ancestor on its path to the root are required.
BoundIsNullandBoundNotNullno longer fold on direct construction.Are these changes tested?
Yes. Added coverage for the schema path check, for binding a required leaf under an optional ancestor and a required ancestor, and for direct construction not folding. Also added a scan regression test that appends a null optional struct with a required child and checks that
IsNull("s.x")keeps the file andNotNull("s.x")returns no rows.tests/test_schema.py tests/expressions: 965 passedtests/io/test_pyarrow.py -m unit: 267 passed, 1 skippedtests/table/test_init.py -m unit: 184 passedAre there any user-facing changes?
No API changes. Scans that filter on a required field under an optional ancestor now return the correct rows instead of no rows.