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 2020/11/09 09:12:08 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #30296: [SPARK-33391][SQL] element_at with CreateArray not respect one based index.

cloud-fan commented on a change in pull request #30296:
URL: https://github.com/apache/spark/pull/30296#discussion_r519653740



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
##########
@@ -1966,7 +1966,7 @@ case class ElementAt(left: Expression, right: Expression)
   }
 
   override def nullable: Boolean = left.dataType match {
-    case _: ArrayType => computeNullabilityFromArray(left, right)
+    case _: ArrayType => computeNullabilityFromArray(left, right, isOneBasedIndex = true)

Review comment:
       how about `computeNullabilityFromArray(left, Subtract(right, Literal(1)))`?




----------------------------------------------------------------
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



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