{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/15346","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/15346/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/15346/comments","events_url":"https://api.github.com/repos/apache/spark/issues/15346/events","html_url":"https://github.com/apache/spark/pull/15346","id":180953679,"number":15346,"title":"[SPARK-17741][SQL] Grammar to parse top level and nested data fields separately","user":{"login":"jiangxb1987","id":4784782,"avatar_url":"https://avatars.githubusercontent.com/u/4784782?v=3","gravatar_id":"","url":"https://api.github.com/users/jiangxb1987","html_url":"https://github.com/jiangxb1987","followers_url":"https://api.github.com/users/jiangxb1987/followers","following_url":"https://api.github.com/users/jiangxb1987/following{/other_user}","gists_url":"https://api.github.com/users/jiangxb1987/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangxb1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangxb1987/subscriptions","organizations_url":"https://api.github.com/users/jiangxb1987/orgs","repos_url":"https://api.github.com/users/jiangxb1987/repos","events_url":"https://api.github.com/users/jiangxb1987/events{/privacy}","received_events_url":"https://api.github.com/users/jiangxb1987/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-10-04T17:21:28Z","updated_at":"2016-10-08T03:18:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/15346","html_url":"https://github.com/apache/spark/pull/15346","diff_url":"https://github.com/apache/spark/pull/15346.diff","patch_url":"https://github.com/apache/spark/pull/15346.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nCurrently we use the same rule to parse top level and nested data fields. For example:\r\n```\r\ncreate table tbl_x(\r\n  id bigint,\r\n  nested struct<col1:string,col2:string>\r\n)\r\n```\r\nShows both syntaxes. In this PR we split this rule in a top-level and nested rule.\r\n\r\nBefore this PR,\r\n```\r\nsql(\"CREATE TABLE my_tab(column1: INT)\")\r\n``` \r\nworks fine.\r\nAfter this PR, it will throw a `ParseException`:\r\n```\r\nscala> sql(\"CREATE TABLE my_tab(column1: INT)\")\r\norg.apache.spark.sql.catalyst.parser.ParseException:\r\nno viable alternative at input 'CREATE TABLE my_tab(column1:'(line 1, pos 27)\r\n```\r\n\r\n## How was this patch tested?\r\nAdd new testcases in `SparkSqlParserSuite`."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/252399370","html_url":"https://github.com/apache/spark/pull/15346#issuecomment-252399370","issue_url":"https://api.github.com/repos/apache/spark/issues/15346","id":252399370,"user":{"login":"jiangxb1987","id":4784782,"avatar_url":"https://avatars.githubusercontent.com/u/4784782?v=3","gravatar_id":"","url":"https://api.github.com/users/jiangxb1987","html_url":"https://github.com/jiangxb1987","followers_url":"https://api.github.com/users/jiangxb1987/followers","following_url":"https://api.github.com/users/jiangxb1987/following{/other_user}","gists_url":"https://api.github.com/users/jiangxb1987/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangxb1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangxb1987/subscriptions","organizations_url":"https://api.github.com/users/jiangxb1987/orgs","repos_url":"https://api.github.com/users/jiangxb1987/repos","events_url":"https://api.github.com/users/jiangxb1987/events{/privacy}","received_events_url":"https://api.github.com/users/jiangxb1987/received_events","type":"User","site_admin":false},"created_at":"2016-10-08T03:18:30Z","updated_at":"2016-10-08T03:18:30Z","body":"@hvanhovell Could you please look at this? Thank you!"}}
{"actor":{"display_login":"jiangxb1987"}}