GitHub user gatorsmile opened a pull request:
https://github.com/apache/spark/pull/13886
[SPARK-16185] [SQL] Better Error Messages When Creating Table As Select
Without Enabling Hive Support
#### What changes were proposed in this pull request?
When we do not turn on the Hive Support, the following query generates a
confusing error message:
```Scala
sql("CREATE TABLE t2 USING parquet SELECT a, b from t1")
```
```
unresolved operator 'CreateHiveTableAsSelectLogicalPlan CatalogTable(
Table: `t`
Created: Fri Jun 24 00:09:15 PDT 2016
Last Access: Wed Dec 31 15:59:59 PST 1969
Type: MANAGED
Storage(InputFormat: org.apache.hadoop.mapred.TextInputFormat,
OutputFormat: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat)),
false;
org.apache.spark.sql.AnalysisException: unresolved operator
'CreateHiveTableAsSelectLogicalPlan CatalogTable(
Table: `t`
Created: Fri Jun 24 00:09:15 PDT 2016
Last Access: Wed Dec 31 15:59:59 PST 1969
Type: MANAGED
Storage(InputFormat: org.apache.hadoop.mapred.TextInputFormat,
OutputFormat: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat)),
false;
```
This PR is to issue a better error message:
```
Hive support is required to use CREATE TABLE AS SELECT
```
#### How was this patch tested?
Added test cases in `DDLSuite.scala`
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gatorsmile/spark createCatalogedTableAsSelect
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/13886.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #13886
----
commit 81413e08e2f347786cde71dcfcbf6c590af0d80b
Author: gatorsmile <[email protected]>
Date: 2016-06-24T07:08:06Z
fix
commit 8947445ce9ea81e0d91814dfd4aa5eb2bb014b85
Author: gatorsmile <[email protected]>
Date: 2016-06-24T07:13:09Z
clean test case
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]