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

Fix max and min value for decimal precision greater than 38 #2245

Merged
merged 1 commit into from
Jul 31, 2022

Conversation

viirya
Copy link
Member

@viirya viirya commented Jul 30, 2022

Which issue does this PR close?

Closes #2246.

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
@viirya viirya changed the title Fix max and min value for decimal precision > 38 Fix max and min value for decimal precision greater than 38 Jul 30, 2022
@@ -309,7 +309,6 @@ pub const MAX_DECIMAL_FOR_EACH_PRECISION: [i128; 38] = [
/// `MAX_DECIMAL_FOR_LARGER_PRECISION[p]` holds the maximum integer value
/// that can be stored in [DataType::Decimal256] value of precision `p` > 38
pub const MAX_DECIMAL_FOR_LARGER_PRECISION: [&str; 38] = [
"99999999999999999999999999999999999999",
Copy link
Member Author

@viirya viirya Jul 30, 2022

Choose a reason for hiding this comment

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

This is only 38 digits, it should be 39. 😓

@@ -395,7 +395,6 @@ pub const MIN_DECIMAL_FOR_EACH_PRECISION: [i128; 38] = [
/// `MIN_DECIMAL_FOR_LARGER_PRECISION[p]` holds the minimum integer value
/// that can be stored in a [DataType::Decimal256] value of precision `p` > 38
pub const MIN_DECIMAL_FOR_LARGER_PRECISION: [&str; 38] = [
"-99999999999999999999999999999999999999",
Copy link
Member Author

Choose a reason for hiding this comment

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

ditto.

@codecov-commenter
Copy link

Codecov Report

Merging #2245 (d99cec4) into master (d727618) will decrease coverage by 0.00%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #2245      +/-   ##
==========================================
- Coverage   82.30%   82.30%   -0.01%     
==========================================
  Files         240      241       +1     
  Lines       62436    62437       +1     
==========================================
  Hits        51391    51391              
- Misses      11045    11046       +1     
Impacted Files Coverage Δ
arrow/src/array/array_decimal.rs 90.32% <ø> (ø)
arrow/src/array/data.rs 85.03% <ø> (ø)
arrow/src/datatypes/datatype.rs 62.61% <16.66%> (-0.08%) ⬇️
arrow/src/compute/kernels/cast.rs 95.82% <50.00%> (ø)
arrow/src/array/builder/decimal_builder.rs 86.09% <100.00%> (-0.19%) ⬇️
arrow/src/array/mod.rs 100.00% <0.00%> (ø)
integration-testing/src/lib.rs 0.00% <0.00%> (ø)
parquet_derive/src/parquet_field.rs 65.98% <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%) ⬆️
... and 2 more

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

@viirya viirya merged commit 281cd79 into apache:master Jul 31, 2022
@ursabot
Copy link

ursabot commented Jul 31, 2022

Benchmark runs are scheduled for baseline = f41fb1c and contender = 281cd79. 281cd79 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

@alamb
Copy link
Contributor

alamb commented Aug 1, 2022

(Integration testing for the win!)

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.

Fix maximum and minimum for decimal values for precision greater than 38
5 participants