Theodus opened a new issue, #24538:
URL: https://github.com/apache/datafusion/issues/24538
### 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
```rust
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_
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]