-
Notifications
You must be signed in to change notification settings - Fork 784
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
Check overflow when casting integer to decimal #3009
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the two cast_integer_to_decimal methods could be combined together? 🤔
It's doable. I combined them in latest commit. |
Going to fix clippy errors: #3010 |
5b356ad
to
797ecc4
Compare
arrow-array/src/types.rs
Outdated
@@ -521,6 +524,10 @@ impl DecimalType for Decimal128Type { | |||
format_decimal_str(&value.to_string(), precision as usize, scale as usize) | |||
} | |||
|
|||
fn format_decimal_type(precision: u8, scale: u8) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way we have handled this in other places is an associated const PREFIX
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to PREFIX
way.
Benchmark runs are scheduled for baseline = 8400b09 and contender = 766f69f. 766f69f is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Part of #2986.
This deals with the case of casting integer to decimal.
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?