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:19 UTC
[I] panic: nth_value window function negates i64::MIN [datafusion]
Dandandan opened a new issue, #22222:
URL: https://github.com/apache/datafusion/issues/22222
### Describe the bug
`nth_value` panics during execution when given `i64::MIN` as the `n` argument. The evaluator negates negative `n` values for reverse indexing.
### To Reproduce
```sql
SELECT nth_value(x, -9223372036854775808) OVER (ORDER BY x)
FROM (VALUES (1)) AS t(x);
```
### Actual behavior
```text
thread 'main' panicked at datafusion/functions-window/src/nth_value.rs:417:45:
attempt to negate with overflow
```
### Expected behavior
Return an execution error for an invalid `n` value, 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: 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: nth_value window function negates i64::MIN [datafusion]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on issue #22222:
URL: https://github.com/apache/datafusion/issues/22222#issuecomment-4469906716
take
--
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
Re: [I] panic: nth_value window function negates i64::MIN [datafusion]
Posted by "xiedeyantu (via GitHub)" <gi...@apache.org>.
xiedeyantu commented on issue #22222:
URL: https://github.com/apache/datafusion/issues/22222#issuecomment-4555158054
@Jefffrey mentioned “Would the same issue happen for the aggregate version of this function?”. Could you elaborate?
--
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
Re: [I] panic: nth_value window function negates i64::MIN [datafusion]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey closed issue #22222: panic: nth_value window function negates i64::MIN
URL: https://github.com/apache/datafusion/issues/22222
--
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