Skip to content
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 returns incorrect length with empty fields #6732

Open
gatesn opened this issue Nov 14, 2024 · 0 comments
Open

StructArray take returns incorrect length with empty fields #6732

gatesn opened this issue Nov 14, 2024 · 0 comments
Labels

Comments

@gatesn
Copy link

gatesn commented Nov 14, 2024

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:

  • Adding StructArray::try_new(fields, arrays, nulls, length)
  • Making StructArray::try_new(fields, arrays, nulls) return an error for empty fields instead of picking a default length
@gatesn gatesn added the bug label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant