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 2023/01/13 04:55:16 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #39546: [SPARK-42045][SQL] ANSI SQL mode: Round/Bround should return an error on integer overflow

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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala:
##########
@@ -1584,9 +1600,17 @@ abstract class RoundBase(child: Expression, scale: Expression,
         }
       case IntegerType =>
         if (_scale < 0) {
-          s"""
-          ${ev.value} = new java.math.BigDecimal(${ce.value}).
+          if (ansiEnabled) {
+            val errorContext = getContextOrNullCode(ctx)
+            val evalCode = s"""

Review Comment:
   can we use the standard scala multiple syntax that are also used in other places of the spark codebase?
   ```
   """
     |xxx
     |xxx""".stripMaigin
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

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