mihailotim-db commented on code in PR #50590: URL: https://github.com/apache/spark/pull/50590#discussion_r2055953354
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeExtractors.scala: ########## @@ -314,6 +315,30 @@ case class GetArrayItem( }) } + override def checkInputDataTypes(): TypeCheckResult = { + (left.dataType, right.dataType) match { + case (_: ArrayType, e2) if !e2.isInstanceOf[IntegralType] => + DataTypeMismatch( + errorSubClass = "UNEXPECTED_INPUT_TYPE", + messageParameters = Map( + "paramIndex" -> ordinalNumber(1), + "requiredType" -> toSQLType(IntegerType), + "inputSql" -> toSQLExpr(right), + "inputType" -> toSQLType(right.dataType)) + ) + case (e1, _) if (!e1.isInstanceOf[ArrayType]) => Review Comment: Also can we have `MapTypeHere`? -- 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org