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

Store StructArray entries in MapArray #4085

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

This was something that came up on #4061 (comment)

Not only was the previous formulation redundant, but also was unnecessarily confusing

What changes are included in this PR?

Are there any user-facing changes?

@tustvold tustvold added the api-change Changes to the arrow API label Apr 13, 2023
@github-actions github-actions bot added arrow Changes to the arrow crate parquet Changes to the parquet crate labels Apr 13, 2023
@@ -175,7 +175,7 @@ impl LevelInfoBuilder {
}

/// Given an `array`, write the level data for the elements in `range`
fn write(&mut self, array: &ArrayRef, range: Range<usize>) {
fn write(&mut self, array: &dyn Array, range: Range<usize>) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is necessary because MapArray::entries now returns StructArray instead of &ArrayRef

}

/// Returns a reference to the [`StructArray`] entries of this map
pub fn entries(&self) -> &ArrayRef {
pub fn entries(&self) -> &StructArray {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a breaking change, but I think is significantly easier to understand, especially since it was already documented to be a StructArray 😅

Copy link
Member

@wjones127 wjones127 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@tustvold tustvold merged commit 637d383 into apache:master Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change Changes to the arrow API arrow Changes to the arrow crate parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants