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

    https://github.com/apache/spark/pull/19901#discussion_r155183837
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
 ---
    @@ -237,53 +237,60 @@ case class In(value: Expression, list: 
Seq[Expression]) extends Predicate {
         val javaDataType = ctx.javaType(value.dataType)
         val valueGen = value.genCode(ctx)
         val listGen = list.map(_.genCode(ctx))
    -    ctx.addMutableState(ctx.JAVA_BOOLEAN, ev.value)
    -    ctx.addMutableState(ctx.JAVA_BOOLEAN, ev.isNull)
    +    // inTmpResult -1 indicates at lease one expr in list is evaluated to 
null.
    +    // 0 means no matches found. 1 means the expr in list matches the 
given value expr.
    +    val inTmpResult = ctx.freshName("inTmpResult")
    --- End diff --
    
    also here I think there is no need for this and we can use the same 
approach used in coalesce.


---

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

Reply via email to