-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: zip now treats nulls as false in provided mask regardless of the underlying bit value
#8711
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
fix: zip now treats nulls as false in provided mask regardless of the underlying bit value
#8711
Conversation
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.
Thank you @rluvaton -- I verified that the newly added tests fail without the code modifications.
I also went through the code and tests carefully and it makes sense to me 👍
arrow-select/src/zip.rs
Outdated
| let scalar_truthy = Int32Array::from_iter_values(vec![1, 2, 3, 4, 5, 6]); | ||
| let scalar_falsy = Int32Array::from_iter_values(vec![7, 8, 9, 10, 11, 12]); |
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.
nit is that these are not scalars (they are arrays)
| let scalar_truthy = Int32Array::from_iter_values(vec![1, 2, 3, 4, 5, 6]); | |
| let scalar_falsy = Int32Array::from_iter_values(vec![7, 8, 9, 10, 11, 12]); | |
| let truthy = Int32Array::from_iter_values(vec![1, 2, 3, 4, 5, 6]); | |
| let falsy = Int32Array::from_iter_values(vec![7, 8, 9, 10, 11, 12]); |
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.
will fix now, thanks
arrow-select/src/zip.rs
Outdated
|
|
||
| #[test] | ||
| fn test_zip_string_array_with_nulls_is_mask_should_be_treated_as_false() { | ||
| let scalar_truthy = StringArray::from_iter_values(vec!["1", "2", "3", "4", "5", "6"]); |
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.
ditto here, these are not scalar
| } | ||
|
|
||
| fn maybe_prep_null_mask_filter(predicate: &BooleanArray) -> BooleanBuffer { | ||
| // Nulls are treated as false |
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.
as a follow on PR this would be a nice improvement to make to prep_null_mask_filter itself -- handling arrays without nulls
|
updated |
|
🤖 |
|
Thank you @rluvaton |
|
🤖: Benchmark completed Details
|
Which issue does this PR close?
Rationale for this change
mask
nullsshould be treated asfalse(even if the underlying values are not 0) as described in the docs for zipWhat changes are included in this PR?
used
prep_null_mask_filterbefore iterating over the mask,added tests for both scalar and non scalar (to prepare for #8653)
Are these changes tested?
Yes
Are there any user-facing changes?
Kinda