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

   ### Describe the bug
   
   `array_position` panics when the optional `start_from` argument is 
`i64::MIN`. The planner/constant folder subtracts one from the value without 
checking for underflow.
   
   ### To Reproduce
   
   ```sql
   EXPLAIN SELECT array_position([1], 1, -9223372036854775808);
   ```
   
   ### Actual behavior
   
   ```text
   thread 'main' panicked at datafusion/functions-nested/src/position.rs:210:21:
   attempt to subtract with overflow
   ```
   
   ### Expected behavior
   
   Return a normal error for an invalid `start_from` 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: [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