Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19720#discussion_r150410927
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/nullExpressions.scala
 ---
    @@ -72,14 +72,10 @@ case class Coalesce(children: Seq[Expression]) extends 
Expression {
       }
     
       override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
    -    val first = children(0)
    -    val rest = children.drop(1)
    -    val firstEval = first.genCode(ctx)
    -    ev.copy(code = s"""
    -      ${firstEval.code}
    -      boolean ${ev.isNull} = ${firstEval.isNull};
    -      ${ctx.javaType(dataType)} ${ev.value} = ${firstEval.value};""" +
    -      rest.map { e =>
    +    ctx.addMutableState("boolean", ev.isNull, s"")
    +    ctx.addMutableState(ctx.javaType(dataType), ev.value, s"")
    --- End diff --
    
    s"" -> ""


---

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

Reply via email to