WeichenXu123 commented on a change in pull request #35699:
URL: https://github.com/apache/spark/pull/35699#discussion_r817265713



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/stat/StatFunctions.scala
##########
@@ -246,14 +246,19 @@ object StatFunctions extends Logging {
     }
     require(percentiles.forall(p => p >= 0 && p <= 1), "Percentiles must be in 
the range [0, 1]")
 
+    def castAsDoubleIfNecessary(e: Expression): Expression = if (e.dataType == 
StringType) {
+      TryCast(e, DoubleType)

Review comment:
       Does try cast return Null if casting failed ?




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

Reply via email to