diff options
author | Andrew Or <andrew@databricks.com> | 2016-03-28 16:45:31 -0700 |
---|---|---|
committer | Andrew Or <andrew@databricks.com> | 2016-03-28 16:45:31 -0700 |
commit | a916d2a454b63a4c234b1e0b5bf9c5b212bd37fa (patch) | |
tree | adf5f2018c129501be7dbaceb51831b39621851e /sql/hive/compatibility | |
parent | 27aab80695cfcf0c0ecf1e98a5a862a8123213a1 (diff) | |
download | spark-a916d2a454b63a4c234b1e0b5bf9c5b212bd37fa.tar.gz spark-a916d2a454b63a4c234b1e0b5bf9c5b212bd37fa.tar.bz2 spark-a916d2a454b63a4c234b1e0b5bf9c5b212bd37fa.zip |
[SPARK-14119][SPARK-14120][SPARK-14122][SQL] Throw exception on unsupported DDL commands
## What changes were proposed in this pull request?
Before: We just pass all role commands to Hive even though it doesn't work.
After: We throw an `AnalysisException` that looks like this:
```
scala> sql("CREATE ROLE x")
org.apache.spark.sql.AnalysisException: Unsupported Hive operation: CREATE ROLE;
at org.apache.spark.sql.hive.HiveQl$$anonfun$parsePlan$1.apply(HiveQl.scala:213)
at org.apache.spark.sql.hive.HiveQl$$anonfun$parsePlan$1.apply(HiveQl.scala:208)
at org.apache.spark.sql.catalyst.parser.CatalystQl.safeParse(CatalystQl.scala:49)
at org.apache.spark.sql.hive.HiveQl.parsePlan(HiveQl.scala:208)
at org.apache.spark.sql.SQLContext.parseSql(SQLContext.scala:198)
```
## How was this patch tested?
`HiveQuerySuite`
Author: Andrew Or <andrew@databricks.com>
Closes #11948 from andrewor14/ddl-role-management.
Diffstat (limited to 'sql/hive/compatibility')
-rw-r--r-- | sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala b/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala index 650797f768..bedbf9ae17 100644 --- a/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala +++ b/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala @@ -291,7 +291,6 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "compute_stats_empty_table", "compute_stats_long", "create_view_translate", - "show_create_table_serde", "show_tblproperties", // Odd changes to output @@ -344,6 +343,15 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { // These tests check the VIEW table definition, but Spark handles CREATE VIEW itself and // generates different View Expanded Text. "alter_view_as_select", + + // We don't support show create table commands in general + "show_create_table_alter", + "show_create_table_db_table", + "show_create_table_delimited", + "show_create_table_does_not_exist", + "show_create_table_index", + "show_create_table_partitioned", + "show_create_table_serde", "show_create_table_view" ) @@ -833,13 +841,6 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "serde_reported_schema", "set_variable_sub", "show_columns", - "show_create_table_alter", - "show_create_table_db_table", - "show_create_table_delimited", - "show_create_table_does_not_exist", - "show_create_table_index", - "show_create_table_partitioned", - "show_create_table_serde", "show_describe_func_quotes", "show_functions", "show_partitions", |