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

Add BooleanArray::into_parts method #5191

Merged
merged 3 commits into from
Dec 8, 2023

Conversation

mbrobbel
Copy link
Contributor

@mbrobbel mbrobbel commented Dec 8, 2023

Rationale for this change

It's currently not possible to take the underlying parts of a BooleanArray.

What changes are included in this PR?

Adds an into_parts method to BooleanArray, following the pattern used for other arrays: https://docs.rs/arrow/latest/arrow/?search=into_parts.

Are there any user-facing changes?

Users can now take the underlying parts of BooleanArray.

@github-actions github-actions bot added the arrow Changes to the arrow crate label Dec 8, 2023
@@ -254,6 +254,11 @@ impl BooleanArray {
});
Self::new(values, nulls)
}

/// Deconstruct this array into its constituent parts
pub fn into_parts(self) -> (DataType, BooleanBuffer, Option<NullBuffer>) {
Copy link
Contributor

@tustvold tustvold Dec 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should mirror the constructor and therefore not return DataType, much like https://docs.rs/arrow-array/latest/arrow_array/array/struct.GenericByteArray.html#method.into_parts

@tustvold tustvold merged commit a43e82c into apache:master Dec 8, 2023
25 checks passed
@mbrobbel mbrobbel deleted the boolean-array-into-parts branch December 8, 2023 15:14
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants