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

Add append_nulls and append_trusted_len_iter to PrimitiveBuilder #728

Merged
merged 3 commits into from
Sep 9, 2021

Conversation

bjchambers
Copy link
Contributor

@bjchambers bjchambers commented Aug 29, 2021

Which issue does this PR close?

Closes #725.

Rationale for this change

Allows appending multiple values / nulls in a single call. This avoids re-checking capacity, etc.

What changes are included in this PR?

Adds append_nulls and append_trusted_len_iter methods to PrimitiveBuilder.

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Aug 29, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #728 (f31e3a1) into master (5a12d97) will increase coverage by 0.02%.
The diff coverage is 88.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #728      +/-   ##
==========================================
+ Coverage   82.50%   82.52%   +0.02%     
==========================================
  Files         168      168              
  Lines       47589    47691     +102     
==========================================
+ Hits        39261    39356      +95     
- Misses       8328     8335       +7     
Impacted Files Coverage Δ
arrow/src/array/builder.rs 86.19% <88.63%> (+0.06%) ⬆️
parquet_derive_test/src/lib.rs 100.00% <0.00%> (ø)
arrow/src/array/array_binary.rs 92.46% <0.00%> (+0.23%) ⬆️
parquet_derive/src/parquet_field.rs 68.86% <0.00%> (+2.69%) ⬆️

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 5a12d97...f31e3a1. 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.

This looks good to me. Thank you @bjchambers

@nevi-me or @jorgecarleitao do you have any thoughts on adding this API. While it is unsafe it seems like there is more than sufficient existing precedent for this type of API

Copy link
Contributor

@nevi-me nevi-me 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 good addition as it will would make builders more efficient than they currently are for appending a lot of values.

@alamb to answer you, I'm fine with the addition.

@alamb
Copy link
Contributor

alamb commented Sep 9, 2021

Merging this in. Thanks @bjchambers ! Sorry for the delay in merging I have been on vacation and am now catching up.

@alamb alamb merged commit 7675164 into apache:master Sep 9, 2021
alamb pushed a commit that referenced this pull request Sep 9, 2021
alamb added a commit that referenced this pull request Sep 10, 2021
#728) (#759)

* stub out impl

* mark unsafe

* add tests

Co-authored-by: Ben Chambers <[email protected]>
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.

append_nulls and append_trusted_len_iter for PrimitiveBuilder
4 participants