diff options
author | Andrew Or <andrew@databricks.com> | 2016-04-05 14:54:07 -0700 |
---|---|---|
committer | Yin Huai <yhuai@databricks.com> | 2016-04-05 14:54:07 -0700 |
commit | 45d8cdee3945bf94d0f1bd93a12e4cb0d416468e (patch) | |
tree | 13e700eeb175a0cbe5419ec62f72a6acfd4c96ea /sql/hive/compatibility/src/test | |
parent | c59abad052b7beec4ef550049413e95578e545be (diff) | |
download | spark-45d8cdee3945bf94d0f1bd93a12e4cb0d416468e.tar.gz spark-45d8cdee3945bf94d0f1bd93a12e4cb0d416468e.tar.bz2 spark-45d8cdee3945bf94d0f1bd93a12e4cb0d416468e.zip |
[SPARK-14129][SPARK-14128][SQL] Alter table DDL commands
## What changes were proposed in this pull request?
In Spark 2.0, we want to handle the most common `ALTER TABLE` commands ourselves instead of passing the entire query text to Hive. This is done using the new `SessionCatalog` API introduced recently.
The commands supported in this patch include:
```
ALTER TABLE ... RENAME TO ...
ALTER TABLE ... SET TBLPROPERTIES ...
ALTER TABLE ... UNSET TBLPROPERTIES ...
ALTER TABLE ... SET LOCATION ...
ALTER TABLE ... SET SERDE ...
```
The commands we explicitly do not support are:
```
ALTER TABLE ... CLUSTERED BY ...
ALTER TABLE ... SKEWED BY ...
ALTER TABLE ... NOT CLUSTERED
ALTER TABLE ... NOT SORTED
ALTER TABLE ... NOT SKEWED
ALTER TABLE ... NOT STORED AS DIRECTORIES
```
For these we throw exceptions complaining that they are not supported.
## How was this patch tested?
`DDLSuite`
Author: Andrew Or <andrew@databricks.com>
Closes #12121 from andrewor14/alter-table-ddl.
Diffstat (limited to 'sql/hive/compatibility/src/test')
-rw-r--r-- | sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala | 10 |
1 files changed, 6 insertions, 4 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 4b4f88ece0..b01f556f0a 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 @@ -360,6 +360,12 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "show_create_table_serde", "show_create_table_view", + // These tests try to change how a table is bucketed, which we don't support + "alter4", + "sort_merge_join_desc_5", + "sort_merge_join_desc_6", + "sort_merge_join_desc_7", + // Index commands are not supported "drop_index", "drop_index_removes_partition_dirs", @@ -381,7 +387,6 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "alias_casted_column", "alter2", "alter3", - "alter4", "alter5", "alter_merge_2", "alter_partition_format_loc", @@ -880,9 +885,6 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "sort_merge_join_desc_2", "sort_merge_join_desc_3", "sort_merge_join_desc_4", - "sort_merge_join_desc_5", - "sort_merge_join_desc_6", - "sort_merge_join_desc_7", "stats0", "stats_aggregator_error_1", "stats_empty_partition", |