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

Impl FromIterator for Decimal256Array #2247

Merged
merged 2 commits into from Aug 2, 2022
Merged

Conversation

viirya
Copy link
Member

@viirya viirya commented Jul 30, 2022

Which issue does this PR close?

Closes #2248.

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jul 30, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 30, 2022

Codecov Report

Merging #2247 (81375f2) into master (d727618) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #2247   +/-   ##
=======================================
  Coverage   82.30%   82.31%           
=======================================
  Files         240      241    +1     
  Lines       62436    62469   +33     
=======================================
+ Hits        51391    51422   +31     
- Misses      11045    11047    +2     
Impacted Files Coverage Δ
arrow/src/array/array_decimal.rs 91.22% <100.00%> (+0.90%) ⬆️
...rquet/src/arrow/record_reader/definition_levels.rs 88.60% <0.00%> (-0.43%) ⬇️
arrow/src/array/builder/decimal_builder.rs 86.09% <0.00%> (-0.19%) ⬇️
arrow/src/datatypes/datatype.rs 62.61% <0.00%> (-0.08%) ⬇️
arrow/src/array/mod.rs 100.00% <0.00%> (ø)
integration-testing/src/lib.rs 0.00% <0.00%> (ø)
arrow/src/array/array_fixed_size_binary.rs 90.37% <0.00%> (ø)
parquet/src/arrow/schema.rs 96.93% <0.00%> (+0.17%) ⬆️
arrow/src/array/array_binary.rs 94.80% <0.00%> (+1.93%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.


let mut null_buf = BooleanBufferBuilder::new(size_hint);

let mut buffer = MutableBuffer::from_len_zeroed(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be better to create this with the required capacity (not zero-ed) up front

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to with_capacity.


/// The default precision and scale used when not specified.
fn default_type() -> DataType {
// Keep maximum precision
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we make the default_type to be a const value or const function? As it could be computed at compile time.

Copy link
Member Author

Choose a reason for hiding this comment

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

trait function cannot be const. I changed it to be a const value.

{
let data = unsafe {
ArrayData::new_unchecked(
U::default_type(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to add the validation with precision/scale to change the default precision/scale for the Decimal256Array like Decimal128Array?

Copy link
Member Author

Choose a reason for hiding this comment

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

FromIterator for Decimal128Array doesn't validate with precision/scale. It uses default precision and scale.

@tustvold tustvold merged commit bde749e into apache:master Aug 2, 2022
@ursabot
Copy link

ursabot commented Aug 2, 2022

Benchmark runs are scheduled for baseline = cd45ecb and contender = bde749e. bde749e 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.

Impl FromIterator for Decimal256Array
6 participants