{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/13572","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/13572/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/13572/comments","events_url":"https://api.github.com/repos/apache/spark/issues/13572/events","html_url":"https://github.com/apache/spark/pull/13572","id":159337151,"number":13572,"title":"[SPARK-15862] [SQL] Better Error Message When Having Database Name in CACHE TABLE AS SELECT","user":{"login":"gatorsmile","id":11567269,"avatar_url":"https://avatars.githubusercontent.com/u/11567269?v=3","gravatar_id":"","url":"https://api.github.com/users/gatorsmile","html_url":"https://github.com/gatorsmile","followers_url":"https://api.github.com/users/gatorsmile/followers","following_url":"https://api.github.com/users/gatorsmile/following{/other_user}","gists_url":"https://api.github.com/users/gatorsmile/gists{/gist_id}","starred_url":"https://api.github.com/users/gatorsmile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gatorsmile/subscriptions","organizations_url":"https://api.github.com/users/gatorsmile/orgs","repos_url":"https://api.github.com/users/gatorsmile/repos","events_url":"https://api.github.com/users/gatorsmile/events{/privacy}","received_events_url":"https://api.github.com/users/gatorsmile/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-06-09T06:32:02Z","updated_at":"2016-06-11T07:29:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/13572","html_url":"https://github.com/apache/spark/pull/13572","diff_url":"https://github.com/apache/spark/pull/13572.diff","patch_url":"https://github.com/apache/spark/pull/13572.patch"},"body":"#### What changes were proposed in this pull request?\r\n~~If the temp table already exists, we should not silently replace it when doing `CACHE TABLE AS SELECT`. This is inconsistent with the behavior of `CREAT VIEW` or `CREATE TABLE`. This PR is to fix this silent drop.~~\r\n\r\n~~Maybe, we also can introduce new syntax for replacing the existing one. For example, in Hive, to replace a view, the syntax should be like `ALTER VIEW AS SELECT` or `CREATE OR REPLACE VIEW AS SELECT`~~\r\n\r\nThe table name in `CACHE TABLE AS SELECT` should NOT contain database prefix like \"database.table\". Thus, this PR captures this in Parser and outputs a better error message, instead of reporting the view already exists.\r\n\r\nIn addition, refactoring the `Parser` to generate table identifiers instead of returning the table name string.\r\n\r\n#### How was this patch tested?\r\n- Added a test case for caching and uncaching qualified table names\r\n- Fixed a few test cases that do not drop temp table at the end\r\n- Added the related test case for the issue resolved in this PR\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/225342243","html_url":"https://github.com/apache/spark/pull/13572#issuecomment-225342243","issue_url":"https://api.github.com/repos/apache/spark/issues/13572","id":225342243,"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-06-11T07:29:29Z","updated_at":"2016-06-11T07:29:29Z","body":"**[Test build #60338 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/60338/consoleFull)** for PR 13572 at commit [`b22c44a`](https://github.com/apache/spark/commit/b22c44ab232fe712547cd6dd6c3180fa9c84d2cf).\n * This patch passes all tests.\n * This patch merges cleanly.\n * This patch adds no public classes."}}
{"actor":{"display_login":"SparkQA"}}