From 8881765ac7ac6ba6fe9ef0d0a669c08cca58ed93 Mon Sep 17 00:00:00 2001 From: Andrew Or Date: Wed, 11 May 2016 15:30:53 -0700 Subject: [SPARK-15257][SQL] Require CREATE EXTERNAL TABLE to specify LOCATION ## What changes were proposed in this pull request? Before: ```sql -- uses warehouse dir anyway CREATE EXTERNAL TABLE my_tab -- doesn't actually delete the data DROP TABLE my_tab ``` After: ```sql -- no location is provided, throws exception CREATE EXTERNAL TABLE my_tab -- creates an external table using that location CREATE EXTERNAL TABLE my_tab LOCATION '/path/to/something' -- doesn't delete the data, which is expected DROP TABLE my_tab ``` ## How was this patch tested? New test in `DDLCommandSuite` Author: Andrew Or Closes #13032 from andrewor14/create-external-table-location. --- .../apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sql/hive/compatibility/src') 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 f89a8479f0..54fb440b33 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 @@ -508,7 +508,10 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { // These tests use EXPLAIN FORMATTED, which is not supported "input4", "join0", - "plan_json" + "plan_json", + + // This test uses CREATE EXTERNAL TABLE without specifying LOCATION + "alter2" ) /** @@ -521,7 +524,6 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "add_partition_no_whitelist", "add_partition_with_whitelist", "alias_casted_column", - "alter2", "alter_partition_with_whitelist", "alter_rename_partition", "ambiguous_col", -- cgit v1.2.3