HyukjinKwon commented on a change in pull request #33672:
URL: https://github.com/apache/spark/pull/33672#discussion_r684864831



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala
##########
@@ -561,15 +561,9 @@ case class JsonToStructs(
 
   override def checkInputDataTypes(): TypeCheckResult = nullableSchema match {
     case _: StructType | _: ArrayType | _: MapType =>
-      val invalidMapType = nullableSchema.existsRecursively(dataType => 
dataType match {
-        case MapType(keyType, _, _) if keyType != StringType => true
-        case _ => false
-      })
-      if (invalidMapType) {
-        TypeCheckResult.TypeCheckFailure(
-          s"Input schema ${nullableSchema.catalogString} can only contain 
StringType " +
-            "as a key type for a MapType.")
-      } else {
+      ExprUtils.checkJsonSchema(nullableSchema).map{

Review comment:
       ```suggestion
         ExprUtils.checkJsonSchema(nullableSchema).map {
   ```




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to