Dandandan opened a new issue, #22223:
URL: https://github.com/apache/datafusion/issues/22223

   ### 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
   
   ```sql
   SELECT lag(x, -9223372036854775808) OVER (ORDER BY x)
   FROM (VALUES (1)) AS t(x);
   ```
   
   ### Actual behavior
   
   ```text
   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.


-- 
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]

Reply via email to