You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "scovich (via GitHub)" <gi...@apache.org> on 2025/10/09 19:38:02 UTC
[I] Decimal -> Decimal cast wrongly fails for large scale reduction [arrow-rs]
scovich opened a new issue, #8579:
URL: https://github.com/apache/arrow-rs/issues/8579
**Describe the bug**
Today, attempting to converting from e.g. `Decimal32(9, 3)` to `Decimal32(9, -7)` fails with an "overflow" error. The overflow in question is computing `pow(10, 3 - (-7))` which indeed overflows 32-bit int.
But that overflow is an implementation detail -- the result of the conversion is perfectly well-defined: `value/10000000000` rounds to zero, for all possible unscaled decimal32 values.
**To Reproduce**
Try to convert `Decimal32(9, 3)` to `Decimal32(9, -7)`
**Expected behavior**
The cast should succeed and produce a column of all-zeros values.
**Additional context**
Discovered by code inspection, as part of reviewing https://github.com/apache/arrow-rs/pull/8552
--
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: github-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Decimal -> Decimal cast wrongly fails for large scale reduction [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #8579: Decimal -> Decimal cast wrongly fails for large scale reduction
URL: https://github.com/apache/arrow-rs/issues/8579
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Decimal -> Decimal cast wrongly fails for large scale reduction [arrow-rs]
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on issue #8579:
URL: https://github.com/apache/arrow-rs/issues/8579#issuecomment-3416683213
`label_issue.py` automatically added labels {'arrow'} from #8580
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org