matthewalex4 opened a new issue, #56615:
URL: https://github.com/apache/spark/issues/56615

   With ANSI mode set, `ceiling` and `floor` saturate to `LONG_MAX`/`LONG_MIN` 
on overflow instead of throwing. This is in contrast to e.g. `abs` which throws 
on overflow.
   
   Steps to reproduce:
   ```sql
   -- throws as specified in the docs
   SELECT abs(-2147483648);
   
   -- should throw but saturates to 9223372036854775807
   SELECT ceiling(1e30);
   
   -- should throw but saturates to -9223372036854775808
   SELECT floor(-1e30);
   Expected: SparkArithmeticException: ARITHMETIC_OVERFLOW
   Actual: 9223372036854775807 / -9223372036854775808
   ```
   


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