Describe the bug
date_bin panics during planning/constant folding when subtracting an extreme timestamp origin from an extreme source timestamp.
To Reproduce
EXPLAIN SELECT date_bin(
INTERVAL '1 nanosecond',
arrow_cast(9223372036854775807, 'Timestamp(Nanosecond, None)'),
arrow_cast(-9223372036854775808, 'Timestamp(Nanosecond, None)')
);
Actual behavior
thread 'main' panicked at datafusion/functions/src/datetime/date_bin.rs:324:21:
attempt to subtract with overflow
Expected behavior
DataFusion should return a planning error for the unrepresentable timestamp difference, not panic.
Notes
The failing operation is the source-origin difference in the date_bin implementation.
Describe the bug
date_binpanics during planning/constant folding when subtracting an extreme timestamp origin from an extreme source timestamp.To Reproduce
Actual behavior
Expected behavior
DataFusion should return a planning error for the unrepresentable timestamp difference, not panic.
Notes
The failing operation is the source-origin difference in the
date_binimplementation.