spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (JIRA)" <>
Subject [jira] [Assigned] (SPARK-21513) SQL to_json should support all column types
Date Mon, 28 Aug 2017 17:35:00 GMT


Apache Spark reassigned SPARK-21513:

    Assignee: Apache Spark

> SQL to_json should support all column types
> -------------------------------------------
>                 Key: SPARK-21513
>                 URL:
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.2.0
>            Reporter: Aaron Davidson
>            Assignee: Apache Spark
>              Labels: Starter
> The built-in SQL UDF "to_json" currently supports serializing StructType columns, as
well as Arrays of StructType columns. If you attempt to use it on a different type, for example
a map, you get an error like this:
> {code}
> AnalysisException: cannot resolve 'structstojson(`tags`)' due to data type mismatch:
Input type map<string,string> must be a struct or array of structs.;;
> {code}
> This limitation seems arbitrary; if I were to go through the effort of enclosing my map
in a struct, it would be serializable. Same thing with any other non-struct type.
> Therefore the desired improvement is to allow to_json to operate directly on any column
type. The associated code is [here|].

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message