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

Update GenericBinaryBuilder to use buffer builders directly. #2117

Merged
merged 5 commits into from Jul 21, 2022

Conversation

HaoYang670
Copy link
Contributor

Which issue does this PR close?

Closes #2104.

Rationale for this change

Don't build binary array from list builder to avoid bugs and extra memory occupation.

What changes are included in this PR?

  1. Update the struct of GenericBinaryBuilder
  2. Remove the method append_byte and append. (append_value and append_null can achieve all functionalities)
  3. More tests to cover the all-null case and builder resetting.
  4. Fix some docs

Are there any user-facing changes?

Yes, remove 2 pub methods append_byte and append.

Signed-off-by: remzi <13716567376yh@gmail.com>
Signed-off-by: remzi <13716567376yh@gmail.com>
Signed-off-by: remzi <13716567376yh@gmail.com>
Signed-off-by: remzi <13716567376yh@gmail.com>
Signed-off-by: remzi <13716567376yh@gmail.com>
@github-actions github-actions bot added the arrow Changes to the arrow crate label Jul 21, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #2117 (c3a9be3) into master (3096591) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2117      +/-   ##
==========================================
+ Coverage   83.76%   83.78%   +0.01%     
==========================================
  Files         225      225              
  Lines       59457    59485      +28     
==========================================
+ Hits        49806    49839      +33     
+ Misses       9651     9646       -5     
Impacted Files Coverage Δ
arrow/src/array/builder/generic_binary_builder.rs 92.00% <100.00%> (+8.66%) ⬆️
parquet_derive/src/parquet_field.rs 65.98% <0.00%> (-0.23%) ⬇️
arrow/src/datatypes/datatype.rs 64.41% <0.00%> (+0.35%) ⬆️
...row/src/array/builder/string_dictionary_builder.rs 91.36% <0.00%> (+0.71%) ⬆️

}

/// Append a null value to the array.
#[inline]
pub fn append_null(&mut self) {
self.append(false)
self.null_buffer_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.

An optimisation we use elsewhere is to lazily create the null builder on first null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, This optimization is only used on primitive builder and boolean builder.
We could do a follow-up to use it on all builders.

@tustvold tustvold merged commit 1805b30 into apache:master Jul 21, 2022
@ursabot
Copy link

ursabot commented Jul 21, 2022

Benchmark runs are scheduled for baseline = fd38664 and contender = 1805b30. 1805b30 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

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.

The GenericBinaryBuilder should use buffer builders directly.
4 participants