You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/09/11 15:12:30 UTC

[GitHub] [spark] wangyum commented on a change in pull request #29731: [WIP][SPARK-32706][SQL] Improve cast string to decimal type

wangyum commented on a change in pull request #29731:
URL: https://github.com/apache/spark/pull/29731#discussion_r487111962



##########
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) {

Review comment:
       `309` to support double. or it is should be `DecimalType.MAX_PRECISION`?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org