mihaibudiu opened a new pull request, #3733:
URL: https://github.com/apache/calcite/pull/3733

   This PR addresses the problem that casts such as `CAST(X as DECIMAL(12, 2))` 
were actually interpreted as no-ops in Calcite.
   With this change the value X is actually rounded to the specified precision 
and scale, and if the result overflows a runtime error is produced. This is in 
line with all the other SQL implementations I have checked.
   
   This PR handles casts where the source type of X is an integer or a decimal 
type, but there may be additional cases to consider. We leave this for a later 
PR.
   
   With this check quite a few tests would fail, so I had to insert additional 
casts to make them pass. This has changed the numeric precision of some results.


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

Reply via email to