apache / arrow-rs

Official Rust implementation of Apache Arrow
https://arrow.apache.org/
Apache License 2.0
2.62k stars 802 forks source link

StructArray take returns incorrect length with empty fields #6732

Open gatesn opened 1 week ago

gatesn commented 1 week ago

Describe the bug Calling compute::take on a struct array with zero fields results in an array with length == 0, regardless of the length of the take array.

Expected behavior The result should be a struct array with no fields and length == take_indices.len()

Additional context In my own code I've found it too easy to drop struct array lengths. I wonder if it's worth: