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

Implement Into<ArrayData> for T: Array #1992

Merged

Conversation

heyrutvik
Copy link
Contributor

Which issue does this PR close?

Closes #1979

Rationale for this change

The method into_data is a cheaper alternative to the more pervasive .data().clone() calls to get underlying array data. It's cheaper since it doesn't clone anything but returns already allocated data (except for ArrayRef).

What changes are included in this PR?

It implements Into indirectly to convert specific array type to general one.

Are there any user-facing changes?

It adds fn into_data(self) -> ArrayData method to Array trait.

@github-actions github-actions bot added arrow Changes to the arrow crate parquet Changes to the parquet crate labels Jul 2, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #1992 (f3e0768) into master (7ae97c9) will decrease coverage by 0.00%.
The diff coverage is 89.14%.

@@            Coverage Diff             @@
##           master    #1992      +/-   ##
==========================================
- Coverage   83.58%   83.57%   -0.01%     
==========================================
  Files         222      222              
  Lines       57495    57542      +47     
==========================================
+ Hits        48056    48090      +34     
- Misses       9439     9452      +13     
Impacted Files Coverage Δ
arrow/src/array/array_decimal.rs 92.88% <0.00%> (-0.79%) ⬇️
.../src/array/builder/primitive_dictionary_builder.rs 78.68% <ø> (ø)
integration-testing/src/lib.rs 0.00% <0.00%> (ø)
arrow/src/array/array_union.rs 90.14% <20.00%> (-0.78%) ⬇️
arrow/src/array/array_map.rs 83.07% <55.55%> (-1.74%) ⬇️
arrow/src/json/reader.rs 84.58% <77.77%> (ø)
arrow/src/array/array.rs 92.05% <83.33%> (-0.16%) ⬇️
arrow/src/array/array_binary.rs 94.29% <100.00%> (+0.08%) ⬆️
arrow/src/array/array_boolean.rs 93.38% <100.00%> (+0.20%) ⬆️
arrow/src/array/array_dictionary.rs 92.06% <100.00%> (+0.12%) ⬆️
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ae97c9...f3e0768. Read the comment docs.

Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

LGTM, thank you 😀

@tustvold tustvold merged commit e436041 into apache:master Jul 4, 2022
@tustvold
Copy link
Contributor

tustvold commented Jul 4, 2022

I'm going to say this isn't a breaking change, as whilst technically Array can be implemented outside this crate, practically the use of as_any means it can't be

@alamb
Copy link
Contributor

alamb commented Jul 7, 2022

Thanks @heyrutvik

@alamb alamb changed the title Implements Into<ArrayData> for T: Array Implement Into<ArrayData> for T: Array Jul 7, 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 parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Into<ArrayData> for T: Array
4 participants