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


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

Review Comment:
   The code is hard to read now. Can we add a new branch for `diff > 
MAX_LONG_DIGITS`?
   ```
   if (diff > MAX_LONG_DIGITS) {
     lv = 0
     roundMode match {
       case ROUND_FLOOR | ... => lv = -1
       case ROUND_CEILING | ... => lv = 1
     }
   } else {
     original code
   }
   ```
   



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