spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cloud-fan <...@git.apache.org>
Subject [GitHub] spark pull request #19598: [SPARK-22378][SQL] Eliminate redundant null check...
Date Sat, 04 Nov 2017 14:01:11 GMT
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19598#discussion_r148931423
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeExtractors.scala
---
    @@ -242,9 +243,11 @@ case class GetArrayItem(child: Expression, ordinal: Expression)
       override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
         nullSafeCodeGen(ctx, ev, (eval1, eval2) => {
           val index = ctx.freshName("index")
    +      val nullCheck = if (!child.dataType.asInstanceOf[ArrayType].containsNull) ""
    +        else s" || $eval1.isNullAt($index)"
    --- End diff --
    
    nit:
    ```
    if {
    
    } else {
    
    }
    ```


---

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


Mime
View raw message