cloud-fan commented on a change in pull request #29983:
URL: https://github.com/apache/spark/pull/29983#discussion_r503328580



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/CentralMomentAgg.scala
##########
@@ -62,6 +63,10 @@ abstract class CentralMomentAgg(child: Expression)
   protected val m3 = AttributeReference("m3", DoubleType, nullable = false)()
   protected val m4 = AttributeReference("m4", DoubleType, nullable = false)()
 
+  protected lazy val divideByZeroEvalResult: Expression = {
+    if (nullOnDivideByZero) Double.NaN else Literal.create(null, DoubleType)

Review comment:
       `if (nullOnDivideByZero) Literal.create(null, DoubleType) else 
Double.NaN`




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

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