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

   ### Describe the bug
   
   `to_timestamp` can panic during planning/constant folding for large 
`Decimal128` values. The decimal-to-nanoseconds conversion multiplies by a 
power of ten without checking for overflow.
   
   ### To Reproduce
   
   ```sql
   EXPLAIN SELECT to_timestamp(
     arrow_cast('99999999999999999999999999999999999999', 'Decimal128(38,0)')
   );
   ```
   
   ### Actual behavior
   
   ```text
   thread 'main' panicked at 
datafusion/functions/src/datetime/to_timestamp.rs:338:9:
   attempt to multiply with overflow
   ```
   
   ### Expected behavior
   
   Return an overflow error instead of panicking.
   
   ### Notes
   
   The panic is in `decimal_to_nanoseconds`.


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