skushagra opened a new pull request, #20793:
URL: https://github.com/apache/datafusion/pull/20793

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and 
enhancements and this helps us generate change logs for our releases. You can 
link an issue to this PR using the GitHub syntax. For example `Closes #123` 
indicates that this PR will close issue #123.
   -->
   
   - Closes #20640 
   
   ## Which issue does this PR fix?
   
   Fixes `FLOOR('-999.9'::DECIMAL(4,1))` producing a "Decimal overflow" error 
instead of returning `-1000`. Same issue affected `CEIL` for the positive 
boundary case.
   
   ## What changes are included in this PR?
   
   - **decimal.rs** — Modified `apply_decimal_op` to:
     - Set output type to `Decimal(p, 0)`.
     - Rescale the result to scale 0.
     - Validate the rescaled value against `Decimal(p, 0)`
   - **floor.rs** — Updated return_type to return `Decimal(p, 0)` for all 
decimal inputs
   - **ceil.rs** — Same return_type change as floor
   
   
   ## Are these changes tested?
   
   Yes
   
   ## Are there any user-facing changes?
   
   Yes. This changes the behaviour of the `floor` and `ceil` functions


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