You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Maxim Gekk (JIRA)" <ji...@apache.org> on 2018/08/27 17:35:00 UTC

[jira] [Created] (SPARK-25252) Support arrays of any types in to_json

Maxim Gekk created SPARK-25252:
----------------------------------

             Summary: Support arrays of any types in to_json
                 Key: SPARK-25252
                 URL: https://issues.apache.org/jira/browse/SPARK-25252
             Project: Spark
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 2.3.1
            Reporter: Maxim Gekk


Need to improve the to_json function and make it more consistent with from_json by supporting arrays of any types (as root types). For now, it supports only arrays of structs and arrays of maps.  After the changes the following code should work:
{code:scala}
select to_json(array('1','2','3'))
> ["1","2","3"]
select to_json(array(array(1,2,3),array(4)))
> [[1,2,3],[4]]
{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