spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (SPARK-24445) Schema in json format for from_json in SQL
Date Thu, 31 May 2018 20:01:00 GMT

     [ https://issues.apache.org/jira/browse/SPARK-24445?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Apache Spark reassigned SPARK-24445:
------------------------------------

    Assignee: Apache Spark

> Schema in json format for from_json in SQL
> ------------------------------------------
>
>                 Key: SPARK-24445
>                 URL: https://issues.apache.org/jira/browse/SPARK-24445
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.3.0
>            Reporter: Maxim Gekk
>            Assignee: Apache Spark
>            Priority: Minor
>
> In Spark 2.3, schema for the from_json function can be specified in JSON format in Scala
and Python but in SQL. In SQL it is impossible to specify map type for example because SQL
DDL parser can handle struct type only. Need to support schemas in JSON format as it has been
already implemented [there|https://github.com/apache/spark/blob/branch-2.3/sql/core/src/main/scala/org/apache/spark/sql/functions.scala#L3225-L3229]:
> {code:scala}
> val dataType = try {
>   DataType.fromJson(schema)
> } catch {
>   case NonFatal(_) => StructType.fromDDL(schema)
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message