You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "Dandandan (via GitHub)" <gi...@apache.org> on 2026/05/15 19:32:17 UTC

[I] panic: lead window function negates i64::MIN offset [datafusion]

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

   ### Describe the bug
   
   `lead` panics during planning when given `i64::MIN` as the offset. The implementation negates lead offsets, and negating `i64::MIN` overflows.
   
   ### To Reproduce
   
   ```sql
   EXPLAIN SELECT lead(x, -9223372036854775808) OVER (ORDER BY x)
   FROM (VALUES (1)) AS t(x);
   ```
   
   ### Actual behavior
   
   ```text
   thread 'main' panicked at .../library/core/src/ops/arith.rs:
   attempt to negate with overflow
   ```
   
   ### Expected behavior
   
   Return a planning error for an invalid offset, not a panic.
   
   ### Notes
   
   The SQL reaches `datafusion/functions-window/src/lead_lag.rs`, where `WindowShiftKind::Lead` maps the offset through `v.neg()`.


-- 
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: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] panic: lead window function negates i64::MIN offset [datafusion]

Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan closed issue #22221: panic: lead window function negates i64::MIN offset
URL: https://github.com/apache/datafusion/issues/22221


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org