wangyum commented on pull request #32090:
URL: https://github.com/apache/spark/pull/32090#issuecomment-817782173
It may be out of range?
```
scala> spark.sql(s"select cast(${Int.MaxValue} as decimal(9, 0)),
cast(${Long.MaxValue} as decimal(18, 0))").show(false)
+--------------------------------+------------------------------------------+
|CAST(2147483647 AS DECIMAL(9,0))|CAST(9223372036854775807 AS DECIMAL(18,0))|
+--------------------------------+------------------------------------------+
|null |null |
+--------------------------------+------------------------------------------+
scala> spark.sql(s"select cast(${Int.MaxValue} as decimal(10, 0)),
cast(${Long.MaxValue} as decimal(19, 0))").show(false)
+---------------------------------+------------------------------------------+
|CAST(2147483647 AS DECIMAL(10,0))|CAST(9223372036854775807 AS
DECIMAL(19,0))|
+---------------------------------+------------------------------------------+
|2147483647 |9223372036854775807
|
+---------------------------------+------------------------------------------+
```
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]