diff options
author | gatorsmile <gatorsmile@gmail.com> | 2017-01-03 11:43:47 -0800 |
---|---|---|
committer | gatorsmile <gatorsmile@gmail.com> | 2017-01-03 11:43:47 -0800 |
commit | b67b35f76b684c5176dc683e7491fd01b43f4467 (patch) | |
tree | 22c57087665b0e490c692ebe3f87fa6bd189b4d3 /sql/core/src/main | |
parent | 89bf370e4f53c02b018b23adc653cd718869489e (diff) | |
download | spark-b67b35f76b684c5176dc683e7491fd01b43f4467.tar.gz spark-b67b35f76b684c5176dc683e7491fd01b43f4467.tar.bz2 spark-b67b35f76b684c5176dc683e7491fd01b43f4467.zip |
[SPARK-19048][SQL] Delete Partition Location when Dropping Managed Partitioned Tables in InMemoryCatalog
### What changes were proposed in this pull request?
The data in the managed table should be deleted after table is dropped. However, if the partition location is not under the location of the partitioned table, it is not deleted as expected. Users can specify any location for the partition when they adding a partition.
This PR is to delete partition location when dropping managed partitioned tables stored in `InMemoryCatalog`.
### How was this patch tested?
Added test cases for both HiveExternalCatalog and InMemoryCatalog
Author: gatorsmile <gatorsmile@gmail.com>
Closes #16448 from gatorsmile/unsetSerdeProp.
Diffstat (limited to 'sql/core/src/main')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala index 522158b641..59a29e8847 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala @@ -400,13 +400,12 @@ case class AlterTableSerDePropertiesCommand( /** * Add Partition in ALTER TABLE: add the table partitions. * - * 'partitionSpecsAndLocs': the syntax of ALTER VIEW is identical to ALTER TABLE, - * EXCEPT that it is ILLEGAL to specify a LOCATION clause. * An error message will be issued if the partition exists, unless 'ifNotExists' is true. * * The syntax of this command is: * {{{ - * ALTER TABLE table ADD [IF NOT EXISTS] PARTITION spec [LOCATION 'loc1'] + * ALTER TABLE table ADD [IF NOT EXISTS] PARTITION spec1 [LOCATION 'loc1'] + * PARTITION spec2 [LOCATION 'loc2'] * }}} */ case class AlterTableAddPartitionCommand( |