tustvold commented on code in PR #3152:
URL: https://github.com/apache/arrow-rs/pull/3152#discussion_r1029064164
##########
arrow-array/src/array/primitive_array.rs:
##########
@@ -1039,7 +1039,14 @@ impl<T: DecimalType + ArrowPrimitiveType>
PrimitiveArray<T> {
Decimal128Type::MAX_SCALE
)));
}
- if scale > precision {
+ if scale < -T::MAX_SCALE {
Review 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 :shrug: -
https://github.com/apache/arrow/blob/91ee6dad722ee154d63eea86ce5644e1e658b53b/cpp/src/arrow/util/decimal.cc#L389
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]