You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/03/04 00:56:45 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #23867: [SPARK-26965][SQL] Makes ElementAt nullability more precise

dongjoon-hyun commented on a change in pull request #23867: [SPARK-26965][SQL] Makes ElementAt nullability more precise
URL: https://github.com/apache/spark/pull/23867#discussion_r261899066
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
 ##########
 @@ -1974,7 +1975,10 @@ case class ElementAt(left: Expression, right: Expression) extends GetMapValueUti
     }
   }
 
-  override def nullable: Boolean = true
+  override def nullable: Boolean = left.dataType match {
+    case _: ArrayType => computeNullabilityFromArray(left, right)
+    case _: MapType => computeNullabilityFromMap
 
 Review comment:
   If `Map` is out of the scope, shall we update the title and use the following code path instead?
   - Remove `extends GetMapValueUtil`.
   - Remove `computeNullabilityFromMap` and use the following.
    ```scala
   case _: MapType => true
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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