sathiyapk commented on a change in pull request #34729:
URL: https://github.com/apache/spark/pull/34729#discussion_r773377737



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
##########
@@ -249,9 +249,9 @@ case class Cbrt(child: Expression) extends 
UnaryMathExpression(math.cbrt, "CBRT"
   """,
   since = "1.4.0",
   group = "math_funcs")
-case class Ceil(child: Expression) extends UnaryMathExpression(math.ceil, 
"CEIL") {
+ case class Ceil(child: Expression) extends UnaryMathExpression(math.ceil, 
"CEIL") {
   override def dataType: DataType = child.dataType match {

Review comment:
       For me personally, returning `DoubleType` for `ceil(c_double, null)` 
don't shock me, but returning `LongType` for `ceil(c_double, null)` might 
probably do. And the same goes for `ceil(c_long, null)`.
   
   But for the moment, i think we could either 
   1. Let `RoundBase` to deal with the scale will null value. or
   2. Throw `AnalysisException` if the scale is null. something like : 
   `if (scaleV == null) throw new AnalysisException("Scale parameter can not be 
null")`
   
   




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