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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
##########
@@ -275,10 +275,27 @@ case class Ceil(child: Expression) extends 
UnaryMathExpression(math.ceil, "CEIL"
       case _ => defineCodeGen(ctx, ev, c => 
s"(long)(java.lang.Math.${funcName}($c))")
     }
   }
-
   override protected def withNewChildInternal(newChild: Expression): Ceil = 
copy(child = newChild)
 }
 
+object Ceil {
+  def apply(child: Expression, scale: Expression): Expression = {
+    if (scale.eval(EmptyRow).asInstanceOf[Int] == 0) {

Review comment:
       This throws exception if `scale` is not literal, right?




-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to