Describe the bug
lag panics during execution when given i64::MIN as the offset. The execution path negates the stored negative shift offset.
To Reproduce
SELECT lag(x, -9223372036854775808) OVER (ORDER BY x)
FROM (VALUES (1)) AS t(x);
Actual behavior
thread 'main' panicked at datafusion/functions-window/src/lead_lag.rs:520:57:
attempt to negate with overflow
Expected behavior
Return an execution error for an invalid offset, not a panic.
Describe the bug
lagpanics during execution when giveni64::MINas the offset. The execution path negates the stored negative shift offset.To Reproduce
Actual behavior
Expected behavior
Return an execution error for an invalid offset, not a panic.