ulysses-you commented on code in PR #37207:
URL: https://github.com/apache/spark/pull/37207#discussion_r923093897
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/decimalExpressions.scala:
##########
@@ -247,3 +247,76 @@ case class DecimalAddNoOverflowCheck(
newLeft: Expression, newRight: Expression): DecimalAddNoOverflowCheck =
copy(left = newLeft, right = newRight)
}
+
+/**
+ * A divide expression for decimal values which is only used internally by Avg.
+ *
+ * It will fail when nullOnOverflow is false follows:
+ * - left is null, as the right side should never be null
Review Comment:
@cloud-fan in fact, it will produce null value if sum overflow. We do not
check the overflow during merging, but the max precison of Spark is limited by
38.. which means the sum value may over 1E38BD
--
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]