morrySnow opened a new pull request, #22134:
URL: https://github.com/apache/doris/pull/22134

   ## Proposed changes
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   
   we convert input parameters to double for function ceil, floor and round,
   because DecimalV2 could not do these operation. Since we intro DecimalV3,
   we should convert all parameters to DecimalV3 to get correct result.
   For example, when we use double as parameters, we get wrong result:
   ```sql
   select round(341/20000,4),341/20000,round(0.01705,4);
   +-------------------------+---------------+-------------------+
   | round((341 / 20000), 4) | (341 / 20000) | round(0.01705, 4) |
   +-------------------------+---------------+-------------------+
   | 0.017                   | 0.01705       | 0.0171            |
   +-------------------------+---------------+-------------------+
   ```
   DecimalV3 could get correct result
   ```sql
   select round(341/20000,4),341/20000,round(0.01705,4);
   +-------------------------+---------------+-------------------+
   | round((341 / 20000), 4) | (341 / 20000) | round(0.01705, 4) |
   +-------------------------+---------------+-------------------+
   | 0.0171                  | 0.01705       | 0.0171            |
   +-------------------------+---------------+-------------------+
   ```
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


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