Support decimal negative scale#3152
Conversation
f880bd4 to
a782f91
Compare
a782f91 to
0ae98a8
Compare
tustvold
left a comment
There was a problem hiding this comment.
I think we probably want to do a quick parse over the codebase for places that assume the scale is unsigned.
Doing a search for scale as shows a couple of scale as usize which are likely incorrect
| ))); | ||
| } | ||
| if scale > precision { | ||
| if scale < -T::MAX_SCALE { |
There was a problem hiding this comment.
I wasn't sure about this, as the rationale for enforcing the upper limit is if the positive scale exceeds the precision it would result in truncation. I'm not sure this applies to the negative direction. However, the C++ version has this same check, so 🤷 - https://github.com/apache/arrow/blob/91ee6dad722ee154d63eea86ce5644e1e658b53b/cpp/src/arrow/util/decimal.cc#L389
These Other Another two is The problematic one is to convert |
|
when I first meet the negative scale, I was confused by this. |
|
Benchmark runs are scheduled for baseline = 6c466af and contender = 78ab0ef. 78ab0ef 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?
Closes #1785.
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?