leanken commented on a change in pull request #30296:
URL: https://github.com/apache/spark/pull/30296#discussion_r519789228
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
##########
@@ -1966,7 +1966,20 @@ case class ElementAt(left: Expression, right: Expression)
}
override def nullable: Boolean = left.dataType match {
- case _: ArrayType => computeNullabilityFromArray(left, right)
+ case _: ArrayType =>
+ def specialNormalizeIndex: (Int, Int) => Int = {
+ (arrayLength: Int, index: Int) => {
+ if (index < 0) {
+ arrayLength + index
+ } else if (index == 0) {
Review comment:
but if the passed in index is 0, it will change to -1 and call the
following code. it will throw exception, but the old behavior is return a
default true.
```
ar(intOrdinal).nullable
```
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]