SAY-5 commented on PR #23433:
URL: https://github.com/apache/datafusion/pull/23433#issuecomment-5011500301

   That makes sense, saturating_sub just avoids the panic without giving a 
clean error at the edges. I'll rework it to keep start_from as the original 
1-based i64 and do the conversion in one shared helper:
   
   - checked_sub(1) on the original value
   - usize::try_from on the result
   - validate the 0-based index against the row length
   - build the out-of-bounds error from the untouched original value (so the 
message shows what the caller actually passed)
   
   Then resolve_start_from and general_position_dispatch both go through that 
helper instead of mapping x - 1 up front. I'll push the refactor and update the 
i64::MIN test to assert the error message.


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