{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/22226","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/22226/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/22226/comments","events_url":"https://api.github.com/repos/apache/spark/issues/22226/events","html_url":"https://github.com/apache/spark/pull/22226","id":353901575,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwODI4ODM0","number":22226,"title":"[SPARK-25252][SQL] Support arrays of any types by to_json","user":{"login":"MaxGekk","id":1580697,"node_id":"MDQ6VXNlcjE1ODA2OTc=","avatar_url":"https://avatars1.githubusercontent.com/u/1580697?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxGekk","html_url":"https://github.com/MaxGekk","followers_url":"https://api.github.com/users/MaxGekk/followers","following_url":"https://api.github.com/users/MaxGekk/following{/other_user}","gists_url":"https://api.github.com/users/MaxGekk/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxGekk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxGekk/subscriptions","organizations_url":"https://api.github.com/users/MaxGekk/orgs","repos_url":"https://api.github.com/users/MaxGekk/repos","events_url":"https://api.github.com/users/MaxGekk/events{/privacy}","received_events_url":"https://api.github.com/users/MaxGekk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-08-24T19:29:04Z","updated_at":"2018-08-28T03:55:38Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/22226","html_url":"https://github.com/apache/spark/pull/22226","diff_url":"https://github.com/apache/spark/pull/22226.diff","patch_url":"https://github.com/apache/spark/pull/22226.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nIn the PR, I propose to extended `to_json` and support any types as element types of input arrays. It should allow converting arrays of primitive types and arrays of arrays. For example:\r\n\r\n```\r\nselect to_json(array('1','2','3'))\r\n> [\"1\",\"2\",\"3\"]\r\nselect to_json(array(array(1,2,3),array(4)))\r\n> [[1,2,3],[4]]\r\n``` \r\n\r\n## How was this patch tested?\r\n\r\nAdded a couple sql tests for arrays of primitive type and of arrays. Also I added round trip test `from_json` -> `to_json`."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/416442935","html_url":"https://github.com/apache/spark/pull/22226#issuecomment-416442935","issue_url":"https://api.github.com/repos/apache/spark/issues/22226","id":416442935,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjQ0MjkzNQ==","user":{"login":"HyukjinKwon","id":6477701,"node_id":"MDQ6VXNlcjY0Nzc3MDE=","avatar_url":"https://avatars0.githubusercontent.com/u/6477701?v=4","gravatar_id":"","url":"https://api.github.com/users/HyukjinKwon","html_url":"https://github.com/HyukjinKwon","followers_url":"https://api.github.com/users/HyukjinKwon/followers","following_url":"https://api.github.com/users/HyukjinKwon/following{/other_user}","gists_url":"https://api.github.com/users/HyukjinKwon/gists{/gist_id}","starred_url":"https://api.github.com/users/HyukjinKwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HyukjinKwon/subscriptions","organizations_url":"https://api.github.com/users/HyukjinKwon/orgs","repos_url":"https://api.github.com/users/HyukjinKwon/repos","events_url":"https://api.github.com/users/HyukjinKwon/events{/privacy}","received_events_url":"https://api.github.com/users/HyukjinKwon/received_events","type":"User","site_admin":false},"created_at":"2018-08-28T03:55:38Z","updated_at":"2018-08-28T03:55:38Z","author_association":"MEMBER","body":"Seems okay but I or someone else should take a closer look before getting this in."}}
{"actor":{"display_login":"HyukjinKwon"}}