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

    https://github.com/apache/spark/pull/21026#discussion_r180598651
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/nullExpressions.scala
 ---
    @@ -352,12 +346,10 @@ case class IsNotNull(child: Expression) extends 
UnaryExpression with Predicate {
     
       override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
         val eval = child.genCode(ctx)
    -    val value = if (eval.isNull == TrueLiteral) {
    -      FalseLiteral
    -    } else if (eval.isNull == FalseLiteral) {
    -      TrueLiteral
    -    } else {
    -      StatementValue(s"(!(${eval.isNull}))", 
CodeGenerator.javaType(dataType))
    +    val value = eval.isNull match {
    +      case TrueLiteral => FalseLiteral
    +      case FalseLiteral => TrueLiteral
    +      case v => JavaCode.isNullExpression(s"!($v)")
    --- End diff --
    
    +1


---

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

Reply via email to