You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/07/31 03:46:51 UTC

[GitHub] [calcite] chunweilei commented on a change in pull request #2089: [CALCITE-4081] Round-tripping a DECIMAL literal throws validation error

chunweilei commented on a change in pull request #2089:
URL: https://github.com/apache/calcite/pull/2089#discussion_r463390290



##########
File path: core/src/test/resources/sql/misc.iq
##########
@@ -1689,7 +1689,7 @@ EnumerableCalc(expr#0=[{inputs}], expr#1=[123:BIGINT], EXPR$0=[$t1])
 !plan
 
 # Cast an integer literal to a decimal; note: the plan does not contain CAST
-values cast('123.45' as decimal(4, 2));
+values cast('123.45' as decimal(5, 2));
 +--------+

Review comment:
       It overflows.
   ```
   chunwei.lcw@chunwei:~$ psql
   psql (12.3)
   Type "help" for help.
   
   chunwei.lcw=# select cast('111.23' as decimal(4, 2));
   ERROR:  numeric field overflow
   DETAIL:  A field with precision 4, scale 2 must round to an absolute value less than 10^2.
   ```
   




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org