From 68be5b9e8a5ac1fc4d243bb54c2ca95fee3f74dc Mon Sep 17 00:00:00 2001 From: gatorsmile Date: Tue, 5 Apr 2016 22:33:44 -0700 Subject: [SPARK-14396][SQL] Throw Exceptions for DDLs of Partitioned Views #### What changes were proposed in this pull request? Because the concept of partitioning is associated with physical tables, we disable all the supports of partitioned views, which are defined in the following three commands in [Hive DDL Manual](https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-Create/Drop/AlterView): ``` ALTER VIEW view DROP [IF EXISTS] PARTITION spec1[, PARTITION spec2, ...]; ALTER VIEW view ADD [IF NOT EXISTS] PARTITION spec; CREATE VIEW [IF NOT EXISTS] [db_name.]view_name [(column_name [COMMENT column_comment], ...) ] [COMMENT view_comment] [TBLPROPERTIES (property_name = property_value, ...)] AS SELECT ...; ``` An exception is thrown when users issue any of these three DDL commands. #### How was this patch tested? Added test cases for parsing create view and changed the existing test cases to verify if the exceptions are thrown. Author: gatorsmile Author: xiaoli Author: Xiao Li Closes #12169 from gatorsmile/viewPartition. --- .../apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sql/hive/compatibility/src/test') 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 b01f556f0a..9e3cb18d45 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 @@ -372,7 +372,11 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "alter_index", // Macro commands are not supported - "macro" + "macro", + + // Create partitioned view is not supported + "create_like_view", + "describe_formatted_view_partitioned" ) /** @@ -482,7 +486,6 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "cp_mj_rc", "create_insert_outputformat", "create_like_tbl_props", - "create_like_view", "create_nested_type", "create_skewed_table1", "create_struct_table", @@ -507,7 +510,6 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "default_partition_name", "delimiter", "desc_non_existent_tbl", - "describe_formatted_view_partitioned", "diff_part_input_formats", "disable_file_format_check", "disallow_incompatible_type_change_off", -- cgit v1.2.3