wangyum commented on a change in pull request #29731:
URL: https://github.com/apache/spark/pull/29731#discussion_r487630070
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala
##########
@@ -143,8 +143,12 @@ final class Decimal extends Ordered[Decimal] with
Serializable {
} else if (decimal.scale < 0 &&
!SQLConf.get.allowNegativeScaleOfDecimalEnabled) {
this._precision = decimal.precision - decimal.scale
this._scale = 0
- // set scale to 0 to correct unscaled value
- this.decimalVal = decimal.setScale(0)
+ if (this._precision > 309) {
+ this.decimalVal = null
Review comment:
Yes. I have moved this logical to `Cast`.
----------------------------------------------------------------
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]