{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/97454893","pull_request_review_id":18065214,"id":97454893,"diff_hunk":"@@ -1140,14 +1140,18 @@ class SparkSqlAstBuilder(conf: SQLConf) extends AstBuilder {\n    *\n    * For example:\n    * {{{\n-   *   CREATE TABLE [IF NOT EXISTS] [db_name.]table_name\n-   *   LIKE [other_db_name.]existing_table_name\n+   *   CREATE [EXTERNAL] TABLE [IF NOT EXISTS] [db_name.]table_name\n+   *   LIKE [other_db_name.]existing_table_name [locationSpec]\n    * }}}\n    */\n   override def visitCreateTableLike(ctx: CreateTableLikeContext): LogicalPlan = withOrigin(ctx) {\n     val targetTable = visitTableIdentifier(ctx.target)\n     val sourceTable = visitTableIdentifier(ctx.source)\n-    CreateTableLikeCommand(targetTable, sourceTable, ctx.EXISTS != null)\n+    val location = Option(ctx.locationSpec).map(visitLocationSpec)\n+    if (ctx.EXTERNAL != null && location.isEmpty) {","path":"sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala","position":15,"original_position":15,"commit_id":"713ca9752a7e37b9e1d52dc0b3171c9c3888ab19","original_commit_id":"713ca9752a7e37b9e1d52dc0b3171c9c3888ab19","user":{"login":"ouyangxiaochen","id":22695134,"avatar_url":"https://avatars.githubusercontent.com/u/22695134?v=3","gravatar_id":"","url":"https://api.github.com/users/ouyangxiaochen","html_url":"https://github.com/ouyangxiaochen","followers_url":"https://api.github.com/users/ouyangxiaochen/followers","following_url":"https://api.github.com/users/ouyangxiaochen/following{/other_user}","gists_url":"https://api.github.com/users/ouyangxiaochen/gists{/gist_id}","starred_url":"https://api.github.com/users/ouyangxiaochen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ouyangxiaochen/subscriptions","organizations_url":"https://api.github.com/users/ouyangxiaochen/orgs","repos_url":"https://api.github.com/users/ouyangxiaochen/repos","events_url":"https://api.github.com/users/ouyangxiaochen/events{/privacy}","received_events_url":"https://api.github.com/users/ouyangxiaochen/received_events","type":"User","site_admin":false},"body":"OK, I'll do it later, Thanks!","created_at":"2017-01-24T01:09:16Z","updated_at":"2017-01-24T01:09:16Z","html_url":"https://github.com/apache/spark/pull/16638#discussion_r97454893","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/16638","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/97454893"},"html":{"href":"https://github.com/apache/spark/pull/16638#discussion_r97454893"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/16638"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/16638","id":102194896,"html_url":"https://github.com/apache/spark/pull/16638","diff_url":"https://github.com/apache/spark/pull/16638.diff","patch_url":"https://github.com/apache/spark/pull/16638.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/16638","number":16638,"state":"open","locked":false,"title":"[SPARK-19115] [SQL] Supporting Create External Table Like Location","user":{"login":"ouyangxiaochen","id":22695134,"avatar_url":"https://avatars.githubusercontent.com/u/22695134?v=3","gravatar_id":"","url":"https://api.github.com/users/ouyangxiaochen","html_url":"https://github.com/ouyangxiaochen","followers_url":"https://api.github.com/users/ouyangxiaochen/followers","following_url":"https://api.github.com/users/ouyangxiaochen/following{/other_user}","gists_url":"https://api.github.com/users/ouyangxiaochen/gists{/gist_id}","starred_url":"https://api.github.com/users/ouyangxiaochen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ouyangxiaochen/subscriptions","organizations_url":"https://api.github.com/users/ouyangxiaochen/orgs","repos_url":"https://api.github.com/users/ouyangxiaochen/repos","events_url":"https://api.github.com/users/ouyangxiaochen/events{/privacy}","received_events_url":"https://api.github.com/users/ouyangxiaochen/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\nSupport CREATE [EXTERNAL] TABLE LIKE  LOCATION...  syntax for Hive tables.\r\nIn this PR,we follow SparkSQL design rules :\r\n1. supporting create external table  like view or physical table or temporary view  with location.\r\n2. creating an external table without location,we will throw a OpreationNotAllowed exception.\r\n3. creating a managed table with location,this table will be an external table other than managed table.\r\n\r\n\r\n## How was this patch tested?\r\n Add new test cases and update existing test cases \r\n","created_at":"2017-01-19T03:20:34Z","updated_at":"2017-01-24T01:09:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0e8c4b60771fd9e739f67eea70d9803b1339ff4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/16638/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/16638/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/16638/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/713ca9752a7e37b9e1d52dc0b3171c9c3888ab19","head":{"label":"ouyangxiaochen:spark19115","ref":"spark19115","sha":"713ca9752a7e37b9e1d52dc0b3171c9c3888ab19","user":{"login":"ouyangxiaochen","id":22695134,"avatar_url":"https://avatars.githubusercontent.com/u/22695134?v=3","gravatar_id":"","url":"https://api.github.com/users/ouyangxiaochen","html_url":"https://github.com/ouyangxiaochen","followers_url":"https://api.github.com/users/ouyangxiaochen/followers","following_url":"https://api.github.com/users/ouyangxiaochen/following{/other_user}","gists_url":"https://api.github.com/users/ouyangxiaochen/gists{/gist_id}","starred_url":"https://api.github.com/users/ouyangxiaochen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ouyangxiaochen/subscriptions","organizations_url":"https://api.github.com/users/ouyangxiaochen/orgs","repos_url":"https://api.github.com/users/ouyangxiaochen/repos","events_url":"https://api.github.com/users/ouyangxiaochen/events{/privacy}","received_events_url":"https://api.github.com/users/ouyangxiaochen/received_events","type":"User","site_admin":false},"repo":{"id":79408291,"name":"spark","full_name":"ouyangxiaochen/spark","owner":{"login":"ouyangxiaochen","id":22695134,"avatar_url":"https://avatars.githubusercontent.com/u/22695134?v=3","gravatar_id":"","url":"https://api.github.com/users/ouyangxiaochen","html_url":"https://github.com/ouyangxiaochen","followers_url":"https://api.github.com/users/ouyangxiaochen/followers","following_url":"https://api.github.com/users/ouyangxiaochen/following{/other_user}","gists_url":"https://api.github.com/users/ouyangxiaochen/gists{/gist_id}","starred_url":"https://api.github.com/users/ouyangxiaochen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ouyangxiaochen/subscriptions","organizations_url":"https://api.github.com/users/ouyangxiaochen/orgs","repos_url":"https://api.github.com/users/ouyangxiaochen/repos","events_url":"https://api.github.com/users/ouyangxiaochen/events{/privacy}","received_events_url":"https://api.github.com/users/ouyangxiaochen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ouyangxiaochen/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/ouyangxiaochen/spark","forks_url":"https://api.github.com/repos/ouyangxiaochen/spark/forks","keys_url":"https://api.github.com/repos/ouyangxiaochen/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ouyangxiaochen/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ouyangxiaochen/spark/teams","hooks_url":"https://api.github.com/repos/ouyangxiaochen/spark/hooks","issue_events_url":"https://api.github.com/repos/ouyangxiaochen/spark/issues/events{/number}","events_url":"https://api.github.com/repos/ouyangxiaochen/spark/events","assignees_url":"https://api.github.com/repos/ouyangxiaochen/spark/assignees{/user}","branches_url":"https://api.github.com/repos/ouyangxiaochen/spark/branches{/branch}","tags_url":"https://api.github.com/repos/ouyangxiaochen/spark/tags","blobs_url":"https://api.github.com/repos/ouyangxiaochen/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ouyangxiaochen/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ouyangxiaochen/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/ouyangxiaochen/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ouyangxiaochen/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/ouyangxiaochen/spark/languages","stargazers_url":"https://api.github.com/repos/ouyangxiaochen/spark/stargazers","contributors_url":"https://api.github.com/repos/ouyangxiaochen/spark/contributors","subscribers_url":"https://api.github.com/repos/ouyangxiaochen/spark/subscribers","subscription_url":"https://api.github.com/repos/ouyangxiaochen/spark/subscription","commits_url":"https://api.github.com/repos/ouyangxiaochen/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/ouyangxiaochen/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/ouyangxiaochen/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/ouyangxiaochen/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/ouyangxiaochen/spark/contents/{+path}","compare_url":"https://api.github.com/repos/ouyangxiaochen/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ouyangxiaochen/spark/merges","archive_url":"https://api.github.com/repos/ouyangxiaochen/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ouyangxiaochen/spark/downloads","issues_url":"https://api.github.com/repos/ouyangxiaochen/spark/issues{/number}","pulls_url":"https://api.github.com/repos/ouyangxiaochen/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/ouyangxiaochen/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/ouyangxiaochen/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ouyangxiaochen/spark/labels{/name}","releases_url":"https://api.github.com/repos/ouyangxiaochen/spark/releases{/id}","deployments_url":"https://api.github.com/repos/ouyangxiaochen/spark/deployments","created_at":"2017-01-19T02:46:35Z","updated_at":"2017-01-19T02:47:00Z","pushed_at":"2017-01-23T00:37:50Z","git_url":"git://github.com/ouyangxiaochen/spark.git","ssh_url":"git@github.com:ouyangxiaochen/spark.git","clone_url":"https://github.com/ouyangxiaochen/spark.git","svn_url":"https://github.com/ouyangxiaochen/spark","homepage":null,"size":261950,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"0c9231858866eff16f97df073d22811176fb6b36","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2017-01-24T00:54:21Z","pushed_at":"2017-01-24T01:07:56Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":262214,"stargazers_count":11497,"watchers_count":11497,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10773,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":466,"forks":10773,"open_issues":466,"watchers":11497,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/16638"},"html":{"href":"https://github.com/apache/spark/pull/16638"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/16638"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/16638/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/16638/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/16638/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/713ca9752a7e37b9e1d52dc0b3171c9c3888ab19"}}}}
{"actor":{"display_login":"ouyangxiaochen"}}