Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/21395#discussion_r190033826
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/collectionOperations.scala
---
@@ -1469,6 +1469,7 @@ case class ElementAt(left: Expression, right:
Expression) extends GetMapValueUti
left.dataType match {
case _: ArrayType => IntegerType
case _: MapType => left.dataType.asInstanceOf[MapType].keyType
+ case _ => AnyDataType // no match for a wrong 'left' expression
type
--- End diff --
BTW, normally, we prefer to
```
override def inputTypes: Seq[AbstractDataType] = {
val rightInputType = left.dataType match {
case _: ArrayType => IntegerType
case _: MapType => left.dataType.asInstanceOf[MapType].keyType
case _ => AnyDataType // no match for a wrong 'left' expression type
}
Seq(TypeCollection(ArrayType, MapType), rightInputType)
}
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]