chenhao-db commented on PR #8700:
URL: https://github.com/apache/arrow-rs/pull/8700#issuecomment-3694333388
The current implementation has an overflow issue. You can test with the
following code:
```
let result =
parse_decimal::<Decimal128Type>("20000000000000000000000000000000000002", 38,
0).unwrap();
assert_eq!(result, 20000000000000000000000000000000000002i128);
let result =
parse_decimal::<Decimal128Type>("20000000000000000000000000000000000002.0", 38,
0).unwrap();
assert_eq!(result, 20000000000000000000000000000000000002i128);
```
The first assert will pass. The second assert will fail:
```
assertion `left == right` failed
left: -14028236692093846346337460743176821143
right: 20000000000000000000000000000000000002
```
There is apparently an interger overflow.
--
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]