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

PrimitiveArray::from_iter should omit validity buffer if all values are valid #1856

Closed
jhorstmann opened this issue Jun 13, 2022 · 0 comments · Fixed by #1859
Closed

PrimitiveArray::from_iter should omit validity buffer if all values are valid #1856

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

Comments

@jhorstmann
Copy link
Contributor

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

PrimitiveArray::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 Jun 13, 2022
@alamb alamb changed the title PrimitiveArray::from_iter should omit validity buffer if all values are valid PrimitiveArray::from_iter should omit validity buffer if all values are valid Jun 23, 2022
@alamb alamb added the arrow Changes to the arrow crate label Jun 23, 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants