{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/15354","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/15354/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/15354/comments","events_url":"https://api.github.com/repos/apache/spark/issues/15354/events","html_url":"https://github.com/apache/spark/pull/15354","id":181053533,"number":15354,"title":"[SPARK-17764][SQL] Add `to_json` supporting to convert nested struct column to JSON string","user":{"login":"HyukjinKwon","id":6477701,"avatar_url":"https://avatars.githubusercontent.com/u/6477701?v=3","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-10-05T02:51:08Z","updated_at":"2016-10-08T04:43:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/15354","html_url":"https://github.com/apache/spark/pull/15354","diff_url":"https://github.com/apache/spark/pull/15354.diff","patch_url":"https://github.com/apache/spark/pull/15354.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nThis PR proposes to add `to_json` function in contrast with `from_json` in Scala, Java and Python.\r\n\r\nIt'd be useful if we can convert a same column from/to json. Also, some datasources do not support nested types. If we are forced to save a dataframe into those data sources, we might be able to work around by this function.\r\n\r\nThe usage is as below:\r\n\r\n```scala\r\nval df = Seq(Tuple1(Tuple1(1))).toDF(\"a\")\r\ndf.select(to_json($\"a\").as(\"json\")).show()\r\n```\r\n\r\n```bash\r\n+--------+\r\n|    json|\r\n+--------+\r\n|{\"_1\":1}|\r\n+--------+\r\n```\r\n\r\n## How was this patch tested?\r\n\r\nUnit tests in `JsonFunctionsSuite` and `JsonExpressionsSuite`."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/252402593","html_url":"https://github.com/apache/spark/pull/15354#issuecomment-252402593","issue_url":"https://api.github.com/repos/apache/spark/issues/15354","id":252402593,"user":{"login":"SparkQA","id":8108735,"avatar_url":"https://avatars.githubusercontent.com/u/8108735?v=3","gravatar_id":"","url":"https://api.github.com/users/SparkQA","html_url":"https://github.com/SparkQA","followers_url":"https://api.github.com/users/SparkQA/followers","following_url":"https://api.github.com/users/SparkQA/following{/other_user}","gists_url":"https://api.github.com/users/SparkQA/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkQA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkQA/subscriptions","organizations_url":"https://api.github.com/users/SparkQA/orgs","repos_url":"https://api.github.com/users/SparkQA/repos","events_url":"https://api.github.com/users/SparkQA/events{/privacy}","received_events_url":"https://api.github.com/users/SparkQA/received_events","type":"User","site_admin":false},"created_at":"2016-10-08T04:43:14Z","updated_at":"2016-10-08T04:43:14Z","body":"**[Test build #66558 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/66558/consoleFull)** for PR 15354 at commit [`ecdac76`](https://github.com/apache/spark/commit/ecdac7640194e82ddde222572275ad7987e2bc65).\n * This patch passes all tests.\n * This patch merges cleanly.\n * This patch adds no public classes."}}
{"actor":{"display_login":"SparkQA"}}