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

BooleanArray::from_iter should omit validity buffer if all values are valid #2055

Closed
jhorstmann opened this issue Jul 12, 2022 · 0 comments · Fixed by #2056
Closed

BooleanArray::from_iter should omit validity buffer if all values are valid #2055

jhorstmann opened this issue Jul 12, 2022 · 0 comments · Fixed by #2056
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog performance

Comments

@jhorstmann
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

Similar to #1856, BooleanArray::from_iter currently always initializes and returns a null_buffer, even when all values are valid.

Describe the solution you'd like

Before constructing the ArrayData we could check the count of ones in the validity buffer and mapping it to None if all values are valid. This should not add any overhead as the number of nulls is counted anyway by the ArrayData constructor.

@jhorstmann jhorstmann added the enhancement Any new improvement worthy of a entry in the changelog label Jul 12, 2022
@alamb alamb changed the title BooleanArray::from_iter should omit validity buffer if all values are valid BooleanArray::from_iter should omit validity buffer if all values are valid Jul 21, 2022
@alamb alamb added arrow Changes to the arrow crate performance labels Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants