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 UnionArray FieldData using Type Erasure #1842

Merged
merged 3 commits into from
Jun 16, 2022

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Follow on from #1591

Rationale for this change

mutable_buffer_to_builder created an untyped back-door to creating a BufferBuilder<T> with arbitrary MutableArray. This makes it hard to reason about the invariants of the MutableArray belonging to a BufferBuilder.

What changes are included in this PR?

This instead implements UnionArray using type-erasure, which is safer and less code.

Are there any user-facing changes?

No

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jun 10, 2022
@tustvold tustvold changed the title Strongly typed UnionBuilder Implement UnionArray FieldData using Type Erasure Jun 10, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2022

Codecov Report

Merging #1842 (9b16115) into master (c08e532) will increase coverage by 0.02%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##           master    #1842      +/-   ##
==========================================
+ Coverage   83.49%   83.52%   +0.02%     
==========================================
  Files         201      201              
  Lines       56903    56871      -32     
==========================================
- Hits        47511    47499      -12     
+ Misses       9392     9372      -20     
Impacted Files Coverage Δ
arrow/src/buffer/mutable.rs 90.53% <ø> (ø)
arrow/src/array/builder.rs 87.75% <87.50%> (+0.87%) ⬆️
parquet_derive/src/parquet_field.rs 65.98% <0.00%> (+0.22%) ⬆️

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 c08e532...9b16115. Read the comment docs.

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.

Looks like a nice cleanup to me.

I also checked and this does not appear to change any of the public API, which is 👍

arrow/src/array/builder.rs Outdated Show resolved Hide resolved
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
@tustvold tustvold merged commit 2e3d8dd into apache:master Jun 16, 2022
tustvold added a commit to tustvold/arrow-rs that referenced this pull request Jun 23, 2022
tustvold added a commit that referenced this pull request Jun 23, 2022
…1928)

* Fix merge conflicts from (#1879)

* Split out of decimal_builder (#1843)

* Fix RAT

* Format

* Restore (#1842)
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.

3 participants