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

Provide a helper function to flatten a Chunk that wraps a StructArray #55

Closed
ncpenke opened this issue Jun 30, 2022 · 0 comments
Closed

Comments

@ncpenke
Copy link
Collaborator

ncpenke commented Jun 30, 2022

From the discussion in: #40.

When converting a Vec<S> into an arrow2::Chunk via try_into_arrow where S is a struct, the resulting Chunk will wrap a StructArray. We'd like to facilitate the conversion of this Chunk to another Chunk that directly wraps the fields of the StructArray.

One way this could be accomplished is by introducing a FlattenChunk trait, which defines a flatten method, that consumes a Chunk and returns a modified Chunk with the fields of a StructArray or the original Chunk if it was not wrapping a StructArray. This trait could be implemented for Chunk<A> where A: AsRef<dyn Array>.

@ncpenke ncpenke changed the title Provide a helper function to flatten a Chunk that wraps a StructArray Provide a helper function to flatten a Chunk that wraps a StructArray Jun 30, 2022
nielsmeima pushed a commit to nielsmeima/arrow2-convert that referenced this issue Jul 1, 2022
nielsmeima pushed a commit to nielsmeima/arrow2-convert that referenced this issue Jul 1, 2022
@ncpenke ncpenke closed this as completed in af9c3d0 Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant