cloud-fan commented on a change in pull request #29983:
URL: https://github.com/apache/spark/pull/29983#discussion_r503328058
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
##########
@@ -450,14 +450,20 @@ object TypeCoercion {
case Abs(e @ StringType()) => Abs(Cast(e, DoubleType))
case Sum(e @ StringType()) => Sum(Cast(e, DoubleType))
case Average(e @ StringType()) => Average(Cast(e, DoubleType))
- case StddevPop(e @ StringType()) => StddevPop(Cast(e, DoubleType))
- case StddevSamp(e @ StringType()) => StddevSamp(Cast(e, DoubleType))
+ case StddevPop(e @ StringType(), nullOnDivideByZero) =>
+ StddevPop(Cast(e, DoubleType), nullOnDivideByZero)
Review comment:
can we use
```
case s @ StddevPop(e @ StringType(), _) =>
s.withNewChildren(Seq(Cast(e, DoubleType)))
```
It can retain the `TreeNodeTag` if there are any.
----------------------------------------------------------------
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]