zeroshade commented on code in PR #1707:
URL: https://github.com/apache/arrow-go/pull/1707#discussion_r4758400896
##########
arrow/decimal/decimal.go:
##########
@@ -198,13 +198,11 @@ func fromDecimalLiteral[T interface {
Decimal32 | Decimal64
FitsInPrecision(int32) bool
}](lit decimalstr.Parsed, prec, scale int32, nbits uint) (n T, err error) {
- if scale < 0 {
- // Check the unscaled magnitude before using the scale,
matching the
- // previous MantExp > nbits bound (|x| >= 2^nbits).
- if lit.AtLeastTwoPower(0, int(nbits)) {
- return n, fmt.Errorf("bitlen too large for decimal%d",
nbits)
- }
- } else if lit.AtLeastTwoPower(int64(scale), int(nbits)) {
+ maxScale := MaxScale[T]()
Review Comment:
This is the check that breaks the existing scale-10 Decimal32 tests and the
new `3e19` / -19 Decimal64 case. Please remove it. My earlier suggestion to
bound by `MaxScale[T]()` was wrong.
--
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]