cloud-fan commented on a change in pull request #33186:
URL: https://github.com/apache/spark/pull/33186#discussion_r663631415
##########
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:
The basic math operations (Add, Subtract, etc.) just print something
like `a + b` without showing the ANSI flag. This makes sense to me.
--
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]