ulysses-you commented on a change in pull request #31005:
URL: https://github.com/apache/spark/pull/31005#discussion_r551807475



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/HyperLogLogPlusPlus.scala
##########
@@ -141,9 +141,11 @@ case class HyperLogLogPlusPlus(
 
 object HyperLogLogPlusPlus {
   def validateDoubleLiteral(exp: Expression): Double = exp match {
-    case Literal(d: Double, DoubleType) => d
-    case Literal(dec: Decimal, _) => dec.toDouble
+    case e if e.foldable && e.dataType == DoubleType =>
+      e.eval().asInstanceOf[Double]
+    case e if e.foldable && e.dataType.isInstanceOf[DecimalType] =>
+      e.eval().asInstanceOf[Decimal].toDouble

Review comment:
       I believed it is but I just find a new at `FirstLast`.




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