HyukjinKwon commented on a change in pull request #33186:
URL: https://github.com/apache/spark/pull/33186#discussion_r663578972



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Sum.scala
##########
@@ -151,9 +157,12 @@ case class Sum(child: Expression) extends 
DeclarativeAggregate with ImplicitCast
   override lazy val evaluateExpression: Expression = resultType match {
     case d: DecimalType =>
       If(isEmpty, Literal.create(null, resultType),
-        CheckOverflowInSum(sum, d, !SQLConf.get.ansiEnabled))
+        CheckOverflowInSum(sum, d, !failOnError))
     case _ => sum
   }
 
   override protected def withNewChildInternal(newChild: Expression): Sum = 
copy(child = newChild)
+
+  // The flag `failOnError` won't be shown in the `toString` or `toAggString` 
methods

Review comment:
       Just to make sure, are these same with other expressions? other places 
might have to be fixed (in a separate PR)




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