cloud-fan commented on code in PR #39099:
URL: https://github.com/apache/spark/pull/39099#discussion_r1057424394


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala:
##########
@@ -374,7 +374,7 @@ final class Decimal extends Ordered[Decimal] with 
Serializable {
       if (scale < _scale) {
         // Easier case: we just need to divide our scale down
         val diff = _scale - scale
-        val pow10diff = POW_10(diff)
+        val pow10diff = POW_10(math.min(diff, MAX_LONG_DIGITS))

Review Comment:
   Can we still use compact long to store the decimal value? Shall we go to the 
branch `// Give up on using Longs; switch to BigDecimal, which we'll modify 
below`?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to