Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15901#discussion_r88647109
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
 ---
    @@ -164,28 +232,26 @@ case class Invoke(
           """
         }
     
    -    val setIsNull = if (propagateNull && arguments.nonEmpty) {
    -      s"boolean ${ev.isNull} = ${obj.isNull} || 
${argGen.map(_.isNull).mkString(" || ")};"
    -    } else {
    -      s"boolean ${ev.isNull} = ${obj.isNull};"
    -    }
    -
         // If the function can return null, we do an extra check to make sure 
our null bit is still set
         // correctly.
         val postNullCheck = if (ctx.defaultValue(dataType) == "null") {
           s"${ev.isNull} = ${ev.value} == null;"
         } else {
           ""
         }
    +
         val code = s"""
           ${obj.code}
    -      ${argGen.map(_.code).mkString("\n")}
    -      $setIsNull
    +      boolean ${ev.isNull} = true;
           $javaType ${ev.value} = ${ctx.defaultValue(dataType)};
    -      if (!${ev.isNull}) {
    -        $evaluate
    +      if (!${obj.isNull}) {
    --- End diff --
    
    Anyway, I think this new code looks clearer than before, what do you think? 
@ueshin 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to