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-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to