Describe the bug
date_bin can panic during planning/constant folding when computing the distance for a negative timestamp near i64::MIN.
To Reproduce
EXPLAIN SELECT date_bin(
INTERVAL '3 nanoseconds',
arrow_cast(-9223372036854775808, 'Timestamp(Nanosecond, None)'),
TIMESTAMP '1970-01-01 00:00:00'
);
Actual behavior
thread 'main' panicked at datafusion/functions/src/datetime/date_bin.rs:338:9:
attempt to subtract with overflow
Expected behavior
Return a planning error for the unrepresentable bin computation instead of panicking.
Describe the bug
date_bincan panic during planning/constant folding when computing the distance for a negative timestamp neari64::MIN.To Reproduce
Actual behavior
Expected behavior
Return a planning error for the unrepresentable bin computation instead of panicking.