{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/13886","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/13886/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/13886/comments","events_url":"https://api.github.com/repos/apache/spark/issues/13886/events","html_url":"https://github.com/apache/spark/pull/13886","id":162089860,"number":13886,"title":"[SPARK-16185] [SQL] Better Error Messages When Creating Table As Select Without Enabling Hive Support","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,"assignees":[],"milestone":null,"comments":18,"created_at":"2016-06-24T07:16:31Z","updated_at":"2016-08-10T06:08:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/13886","html_url":"https://github.com/apache/spark/pull/13886","diff_url":"https://github.com/apache/spark/pull/13886.diff","patch_url":"https://github.com/apache/spark/pull/13886.patch"},"body":"#### What changes were proposed in this pull request?\r\nWhen we do not turn on the Hive Support, the following query generates a confusing error message:\r\n```Scala\r\nsql(\"CREATE TABLE t2 SELECT a, b from t1\")\r\n```\r\n\r\n```\r\nunresolved operator 'CreateHiveTableAsSelectLogicalPlan CatalogTable(\r\n\tTable: `t`\r\n\tCreated: Fri Jun 24 00:09:15 PDT 2016\r\n\tLast Access: Wed Dec 31 15:59:59 PST 1969\r\n\tType: MANAGED\r\n\tStorage(InputFormat: org.apache.hadoop.mapred.TextInputFormat, OutputFormat: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat)), false;\r\norg.apache.spark.sql.AnalysisException: unresolved operator 'CreateHiveTableAsSelectLogicalPlan CatalogTable(\r\n\tTable: `t`\r\n\tCreated: Fri Jun 24 00:09:15 PDT 2016\r\n\tLast Access: Wed Dec 31 15:59:59 PST 1969\r\n\tType: MANAGED\r\n\tStorage(InputFormat: org.apache.hadoop.mapred.TextInputFormat, OutputFormat: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat)), false;\r\n```\r\n\r\nThis PR is to issue a better error message: \r\n```\r\nHive support is required to use CREATE TABLE AS SELECT\r\n```\r\n\r\n#### How was this patch tested?\r\nAdded test cases in `DDLSuite.scala`"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/238774277","html_url":"https://github.com/apache/spark/pull/13886#issuecomment-238774277","issue_url":"https://api.github.com/repos/apache/spark/issues/13886","id":238774277,"user":{"login":"cloud-fan","id":3182036,"avatar_url":"https://avatars.githubusercontent.com/u/3182036?v=3","gravatar_id":"","url":"https://api.github.com/users/cloud-fan","html_url":"https://github.com/cloud-fan","followers_url":"https://api.github.com/users/cloud-fan/followers","following_url":"https://api.github.com/users/cloud-fan/following{/other_user}","gists_url":"https://api.github.com/users/cloud-fan/gists{/gist_id}","starred_url":"https://api.github.com/users/cloud-fan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloud-fan/subscriptions","organizations_url":"https://api.github.com/users/cloud-fan/orgs","repos_url":"https://api.github.com/users/cloud-fan/repos","events_url":"https://api.github.com/users/cloud-fan/events{/privacy}","received_events_url":"https://api.github.com/users/cloud-fan/received_events","type":"User","site_admin":false},"created_at":"2016-08-10T06:08:41Z","updated_at":"2016-08-10T06:08:41Z","body":"Can you update the PR description? I think it should throw exception in planner before your PR."}}
{"actor":{"display_login":"cloud-fan"}}