Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22544#discussion_r220533930
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
 ---
    @@ -2140,21 +2140,34 @@ case class ElementAt(left: Expression, right: 
Expression) extends GetMapValueUti
       }
     
       override def inputTypes: Seq[AbstractDataType] = {
    -    Seq(TypeCollection(ArrayType, MapType),
    -      left.dataType match {
    -        case _: ArrayType => IntegerType
    -        case _: MapType => mapKeyType
    -        case _ => AnyDataType // no match for a wrong 'left' expression 
type
    -      }
    -    )
    +    (left.dataType, right.dataType) match {
    +      case (ArrayType(e1, hasNull), e2: IntegralType) if (e2 != LongType) 
=>
    --- End diff --
    
    nit:
    ```
    case (arr: ArrayType, e2: IntegralType) if ... =>
      Seq(arr, IntegerType)
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to