Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21472#discussion_r192342580
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala
 ---
    @@ -747,8 +748,13 @@ case class StructsToJson(
     
     object JsonExprUtils {
     
    -  def validateSchemaLiteral(exp: Expression): StructType = exp match {
    -    case Literal(s, StringType) => 
CatalystSqlParser.parseTableSchema(s.toString)
    +  def validateSchemaLiteral(exp: Expression): DataType = exp match {
    +    case Literal(s, StringType) =>
    +      try {
    +        DataType.fromJson(s.toString)
    --- End diff --
    
    > Schema in DDL supports only `StructType` as root types. It is not 
possible to specify `MapType` like in the test: 
    
    Shall we add the support with type itself with 
`CatalystSqlParser.parseDataType` too? 
    Also, are you able to use `catalogString`?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to