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

   ### Describe the bug
   
   `ceil` and `floor` on `decimal` inputs can raise a spurious overflow because 
it reuses the input value's scale and precision.
   
   ### To Reproduce
   
   ```
   > select ceil(CAST(9.9 AS DECIMAL(2,1)));
   Arrow error: Compute error: Decimal overflow while applying ceil
   > SELECT floor(CAST(-9.9 AS DECIMAL(2,1)));
   Arrow error: Compute error: Decimal overflow while applying floor
   ```
   
   ### Expected behavior
   
   The queries should return `10` and `-10`, respectively, which is what 
Postgres and DuckDB both do.
   
   ### Additional context
   
   _No response_


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