Describe the bug
ScalarValue::iter_to_array accepts scalars with the same enum variant but different DataType parameters. It builds the output array with the first scalar's parameters and discards the later parameters.
This affects:
Decimal32, Decimal64, Decimal128, and Decimal256 precision and scale
Timestamp timezones for every time unit
FixedSizeBinary widths
To Reproduce
use datafusion_common::ScalarValue;
let scalars = [
ScalarValue::Decimal128(Some(100), 10, 2),
ScalarValue::Decimal128(Some(100), 11, 2),
];
// This succeeds and uses precision 10 instead of returning an error.
assert!(ScalarValue::iter_to_array(scalars).is_ok());
Expected behavior
ScalarValue::iter_to_array should return an error when decimal precision, decimal scale, timestamp timezone, or fixed-size binary width differs.
Additional context
No response
Describe the bug
ScalarValue::iter_to_arrayaccepts scalars with the same enum variant but differentDataTypeparameters. It builds the output array with the first scalar's parameters and discards the later parameters.This affects:
Decimal32,Decimal64,Decimal128, andDecimal256precision and scaleTimestamptimezones for every time unitFixedSizeBinarywidthsTo Reproduce
Expected behavior
ScalarValue::iter_to_arrayshould return an error when decimal precision, decimal scale, timestamp timezone, or fixed-size binary width differs.Additional context
No response