You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decimal -> Decimal cast wrongly fails for large scale reduction #8579
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 #8552
Activity
Fix broken decimal->decimal casting with large scale reduction (apach…
alamb commentedon Oct 17, 2025
label_issue.pyautomatically added labels {'arrow'} from #8580Refactor arrow-cast decimal casting to unify the rescale logic used i…