-
Notifications
You must be signed in to change notification settings - Fork 847
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
Simplify decimal cast logic #3264
Conversation
This does represent a performance regression for decimal256 arrays, as previously the logic was incorrectly using i128 arithmetic when it should have been using i256. Correctness is more important and we're talking microseconds, so I think this is fine |
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.
Nice!
(mul * v.as_()).round().to_i128().ok_or_else(|| { | ||
ArrowError::CastError(format!( | ||
"Cannot cast to {}({}, {}). Overflowing on {:?}", | ||
Decimal128Type::PREFIX, | ||
precision, | ||
scale, | ||
v | ||
)) |
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.
👍
Benchmark runs are scheduled for baseline = 09d5f02 and contender = 9f64476. 9f64476 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
thanks @tustvold |
Which issue does this PR close?
Closes #3265
Rationale for this change
The logic was extremely complicated and hard to follow, and suffered from a lot of duplication, leading to inconsistencies such as #3224
What changes are included in this PR?
Are there any user-facing changes?