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

ARROW-11040: [Rust] Simplified builders #9019

Closed
wants to merge 3 commits into from
Closed

ARROW-11040: [Rust] Simplified builders #9019

wants to merge 3 commits into from

Conversation

jorgecarleitao
Copy link
Member

@jorgecarleitao jorgecarleitao commented Dec 26, 2020

This PR simplifies the builders code. It has no semantic, execution or API change.

The main idea here is to generalize [Large]ListBuilder, [Large]StringBuilder, [Large]BinaryBuilder as GenericListBuilder, GenericStringBuilder and GenericBinaryBuilder respectively, thereby removing duplicated code.

The relevant changes in this PR are on src/array/builders.rs only.

@github-actions
Copy link

@codecov-io
Copy link

codecov-io commented Dec 26, 2020

Codecov Report

Merging #9019 (12a5b20) into master (cd22be6) will increase coverage by 0.05%.
The diff coverage is 95.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9019      +/-   ##
==========================================
+ Coverage   82.55%   82.61%   +0.05%     
==========================================
  Files         203      203              
  Lines       50043    49942     -101     
==========================================
- Hits        41315    41259      -56     
+ Misses       8728     8683      -45     
Impacted Files Coverage Δ
rust/arrow/src/array/array_list.rs 93.10% <ø> (ø)
rust/arrow/src/array/builder.rs 85.89% <93.10%> (+1.89%) ⬆️
rust/arrow/src/array/array_binary.rs 90.54% <100.00%> (-0.07%) ⬇️
rust/arrow/src/array/array_string.rs 90.16% <100.00%> (-0.11%) ⬇️
rust/arrow/src/array/transform/list.rs 83.87% <100.00%> (ø)
rust/arrow/src/array/transform/utils.rs 100.00% <100.00%> (ø)
rust/arrow/src/array/transform/variable_size.rs 100.00% <100.00%> (ø)
rust/arrow/src/compute/kernels/substring.rs 98.29% <100.00%> (ø)
rust/arrow/src/compute/util.rs 98.93% <100.00%> (ø)
rust/arrow/src/json/reader.rs 81.47% <100.00%> (ø)
... and 6 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 cd22be6...12a5b20. Read the comment docs.

@jorgecarleitao jorgecarleitao marked this pull request as ready for review December 28, 2020 17:29
Copy link
Member

@waynexia waynexia left a comment

Choose a reason for hiding this comment

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

Nice simplification, I think this is also a good example of how to play with different offset types in a single place 👍

@nevi-me nevi-me self-requested a review December 29, 2020 07:31
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.

Thanks @jorgecarleitao for the simplification

@@ -779,140 +781,31 @@ where
let offset_buffer = self.offsets_builder.finish();
let null_bit_buffer = self.bitmap_builder.finish();
let nulls = null_bit_buffer.count_set_bits();
Copy link
Contributor

Choose a reason for hiding this comment

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

I just noticed that we had named this unintuitively, as we're counting the set bits

Copy link
Member Author

Choose a reason for hiding this comment

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

unset? it proves the point, though 🤣

FYI, @nevi-me , the tests are not running (INFRA team deactivated most actions), so we need to be careful with merging to master. There is a thread in the mailing list about it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, thanks for the heads-up. I'll check my emails

@alamb
Copy link
Contributor

alamb commented Dec 31, 2020

The full set of Rust CI tests did not run on this PR :(

Can you please rebase this PR against apache/master to pick up the changes in #9056 so that they do?

I apologize for the inconvenience.

GeorgeAp pushed a commit to sirensolutions/arrow that referenced this pull request Jun 7, 2021
This PR simplifies the builders code. It has no semantic, execution or API change.

The main idea here is to generalize `[Large]ListBuilder`, `[Large]StringBuilder`, `[Large]BinaryBuilder` as `GenericListBuilder`, `GenericStringBuilder` and `GenericBinaryBuilder` respectively, thereby removing duplicated code.

The relevant changes in this PR are on `src/array/builders.rs` only.

Closes apache#9019 from jorgecarleitao/generic_list

Authored-by: Jorge C. Leitao <jorgecarleitao@gmail.com>
Signed-off-by: Jorge C. Leitao <jorgecarleitao@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants