{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/22939","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/22939/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/22939/comments","events_url":"https://api.github.com/repos/apache/spark/issues/22939/events","html_url":"https://github.com/apache/spark/pull/22939","id":377134992,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4MTY1ODA1","number":22939,"title":"[SPARK-25446][R] Add schema_of_json() and schema_of_csv() to R","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},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":21,"created_at":"2018-11-04T09:16:32Z","updated_at":"2018-11-30T06:12:16Z","closed_at":"2018-11-30T02:33:58Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/22939","html_url":"https://github.com/apache/spark/pull/22939","diff_url":"https://github.com/apache/spark/pull/22939.diff","patch_url":"https://github.com/apache/spark/pull/22939.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nThis PR proposes to expose `schema_of_json` and `schema_of_csv` at R side.\r\n\r\n**`schema_of_json`**:\r\n\r\n```r\r\njson <- '{\"name\":\"Bob\"}'\r\ndf <- sql(\"SELECT * FROM range(1)\")\r\nhead(select(df, schema_of_json(json)))\r\n```\r\n\r\n```\r\n  schema_of_json({\"name\":\"Bob\"})\r\n1            struct<name:string>\r\n```\r\n\r\n**`schema_of_csv`**:\r\n\r\n```r\r\ncsv <- \"Amsterdam,2018\"\r\ndf <- sql(\"SELECT * FROM range(1)\")\r\nhead(select(df, schema_of_csv(csv)))\r\n```\r\n\r\n```\r\n  schema_of_csv(Amsterdam,2018)\r\n1    struct<_c0:string,_c1:int>\r\n```\r\n\r\n## How was this patch tested?\r\n\r\nManually tested, unit tests added, documentation manually built and verified."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/443102484","html_url":"https://github.com/apache/spark/pull/22939#issuecomment-443102484","issue_url":"https://api.github.com/repos/apache/spark/issues/22939","id":443102484,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzEwMjQ4NA==","user":{"login":"felixcheung","id":8969467,"node_id":"MDQ6VXNlcjg5Njk0Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/8969467?v=4","gravatar_id":"","url":"https://api.github.com/users/felixcheung","html_url":"https://github.com/felixcheung","followers_url":"https://api.github.com/users/felixcheung/followers","following_url":"https://api.github.com/users/felixcheung/following{/other_user}","gists_url":"https://api.github.com/users/felixcheung/gists{/gist_id}","starred_url":"https://api.github.com/users/felixcheung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixcheung/subscriptions","organizations_url":"https://api.github.com/users/felixcheung/orgs","repos_url":"https://api.github.com/users/felixcheung/repos","events_url":"https://api.github.com/users/felixcheung/events{/privacy}","received_events_url":"https://api.github.com/users/felixcheung/received_events","type":"User","site_admin":false},"created_at":"2018-11-30T06:12:16Z","updated_at":"2018-11-30T06:12:16Z","author_association":"MEMBER","body":"Error looks reasonable...\n\n"}}
{"actor":{"display_login":"felixcheung"}}