-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(arrow-array): disallow creating MapArray with nullable key field
#10272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rluvaton
wants to merge
9
commits into
apache:main
Choose a base branch
from
rluvaton:disallow-nulls-in-map-keys
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+433
−58
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2ba8294
fix(arrow-array): disallow creating `MapArray` with nullable key field
rluvaton cc9ab6a
fix in array data as well + more validations
rluvaton 83a1ce4
add 2 more tests
rluvaton 112bfd2
lint
rluvaton 20f5ef8
fix: when force_validate feature is true, skip panic
rluvaton 7dac9e5
fix tests to not have nulls in keys
rluvaton 894eae5
Merge branch 'main' into disallow-nulls-in-map-keys
rluvaton b13d6c5
remove bad test
rluvaton a7f5c12
extract helpers
rluvaton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check the data type? Or maybe just the actual contents of the array (
null_count() > 0)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I worry that the data_type is not always set super precisely (as in there may be some code that claims the key is "nullable" for convenience, but in reality the key is not nullable)
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i feel its better to be strict/explicit in this case
for reference, in the builder we also check nullability already:
arrow-rs/arrow-array/src/builder/map_builder.rs
Lines 243 to 247 in b1de629
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already check that entries data type equal to field data type
Which struct is not nullable so it should enforce the no nulls
This is why I did not add it