-
Notifications
You must be signed in to change notification settings - Fork 795
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
StructArray take doesn't make fields nullable #6727
Comments
Generally I wouldn't expect a selection kernel to alter the schema, so I think in this case it should raise an error |
Yes that's also reasonable. It's a bit annoying that Arrow DataTypes don't themselves have a nullable flat, since the selection kernels over non-nested arrays can also introduce nulls to previously non-null arrays. |
take |
One way to get this is to use StructArray in place of RecordBatch, this is actually what a lot of the IO logic in arrow-rs does, converting to RecordBatch at the edges. IMO RecordBatch is confusing and arrow would be better off without it, but it's too late for that now 😅 |
can i fix |
Describe the bug
When calling
arrow::compute::take
on a StructArray with non-nullable fields and passing take indices that contain null values, the resulting StructArray still has non-nullable fields. This is an invalid state.Expected behavior
The take function should convert all fields to nullable iff the take indices contain any nulls.
https://docs.rs/arrow-select/53.2.0/src/arrow_select/take.rs.html#238-239
The text was updated successfully, but these errors were encountered: