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
Casting decimal -> decimal with large scale is buggy #10946
Casting decimal -> decimal with a much larger scale can produce incorrect values, including panics in debug mode.
To Reproduce
use arrow_array::{Array,Decimal256Array};use arrow_buffer::i256;use arrow_cast::{cast_with_options,CastOptions};use arrow_schema::DataType;let array = Decimal256Array::from(vec![
i256::from_i128(1),
i256::from_i128(10_i128.pow(16)),
i256::from_i128(10_i128.pow(17)),]).with_precision_and_scale(76,0).unwrap();// Strict mode; safe mode returns the same values (no nulls, no error)let options = CastOptions{safe:false, ..Default::default()};let result = cast_with_options(&array,&DataType::Decimal256(76,60),&options).unwrap();
Activity
neilconway commentedon Sep 1, 2026
take