Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.28.0
-
None
Description
In calcite. The precision and scale can't work.
1) Add judgment in decimal type precision and scale parameter(When have illegal value need to throw an exception):
SQL EXAMPLES:
cast(155.36 as decimal(0,0))
In Postgresql:
ERROR: NUMERIC precision 0 must be between 1 and 1000
In Calcite:
EXPR$0=155.36
2) To make sure return the right answer。
SQL EXAMPLES:
cast(155.36 as decimal(4,1))
In Postgresql:
EXPR$0=155.4
In Calcite:
EXPR$0=155.36
The problem exists in casting different data to decimal.
Attachments
Issue Links
- is blocked by
-
CALCITE-4924 REGR_SXX and similar aggregate functions return the wrong data type
- In Progress
-
CALCITE-4911 CAST operation should throw an exception when cast DECIMAL type lose significant digits
- Closed
- links to
(1 links to)