beliefer commented on code in PR #37137:
URL: https://github.com/apache/spark/pull/37137#discussion_r917205859
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/linearRegression.scala:
##########
@@ -278,7 +278,8 @@ case class RegrSlope(left: Expression, right: Expression)
extends DeclarativeAgg
covarPop.mergeExpressions ++ varPop.mergeExpressions
override lazy val evaluateExpression: Expression = {
- If(covarPop.n === 0.0, Literal.create(null, DoubleType), covarPop.ck /
varPop.m2)
+ If(Or(covarPop.n === 0.0, varPop.m2 === 0.0),
Review Comment:
At first, I think if the `covarPop.n === 0.0` means `varPop.n === 0.0` and
`varPop.m2 === 0.0`.
It seems `varPop.m2 === 0.0` not determined by `varPop.n === 0.0`.
--
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]