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

Simplify ListArray::from_iter_primitive #2886

Merged
merged 1 commit into from
Oct 18, 2022

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

Drive by cleanup

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Oct 16, 2022
@@ -157,47 +157,26 @@ impl<OffsetSize: OffsetSizeTrait> GenericListArray<OffsetSize> {
pub fn from_iter_primitive<T, P, I>(iter: I) -> Self
where
T: ArrowPrimitiveType,
P: AsRef<[Option<<T as ArrowPrimitiveType>::Native>]>
Copy link
Contributor Author

@tustvold tustvold Oct 16, 2022

Choose a reason for hiding this comment

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

This AsRef constraint is rather constraining, it is good to see it gone

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Is there any benchmark that should be run?

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

This is also an API change as well, is it not? Due to the different type bounds

Self::from(array_data)
builder.append(true);
}
None => builder.append(false),
Copy link
Contributor

Choose a reason for hiding this comment

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

does this need

                    builder.values().append_nulls(l);

As was added in #2887?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, that was only needed because nulls in a fixed size list take up the same amount of space as non-null values

@tustvold
Copy link
Contributor Author

tustvold commented Oct 18, 2022

This is also an API change as well, is it not

Not sure, as it is only removing a trait bound not adding a new one. So it should be backwards compatible

Is there any benchmark that should be run?

Not that I could find, I'm not sure that this method is used anywhere outside of tests

@tustvold tustvold merged commit bf64ab5 into apache:master Oct 18, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants