GitHub user andrewor14 opened a pull request:
https://github.com/apache/spark/pull/12220
[SPARK-14132][SPARK-14133][SQL] Alter table partition DDLs
## What changes were proposed in this pull request?
This implements a few alter table partition commands using the
`SessionCatalog`. In particular:
```
ALTER TABLE ... ADD PARTITION ...
ALTER TABLE ... DROP PARTITION ...
ALTER TABLE ... RENAME PARTITION ... TO ...
```
The following operations are not supported, and an `AnalysisException` with
a helpful error message will be thrown if the user tries to use them:
```
ALTER TABLE ... EXCHANGE PARTITION ...
ALTER TABLE ... ARCHIVE PARTITION ...
ALTER TABLE ... UNARCHIVE PARTITION ...
ALTER TABLE ... TOUCH ...
ALTER TABLE ... COMPACT ...
ALTER TABLE ... CONCATENATE
```
## How was this patch tested?
`DDLSuite`, `DDLCommandSuite` and `HiveDDLCommandSuite`
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/andrewor14/spark alter-partition-ddl
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/12220.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #12220
----
commit b1ea87ed2757dfa5fa48e772575a20959050ef8f
Author: Andrew Or <[email protected]>
Date: 2016-04-06T20:47:45Z
Throw exception for MSCK REPAIR TABLE
commit 1690596460f93377c8192763666a7767b2a17bda
Author: Andrew Or <[email protected]>
Date: 2016-04-06T21:07:48Z
Throw exception on (un)archive partition
commit e24e007a1a8e6dfc03c7477788af7fbc6bdd6a11
Author: Andrew Or <[email protected]>
Date: 2016-04-06T21:45:54Z
Implement add partitions
commit 18de2b39dd25bfd0caf42b83326523e7c46d66b2
Author: Andrew Or <[email protected]>
Date: 2016-04-06T21:48:08Z
Throw exception for exchange partition
commit 70586761f48fc98ea6c8131445c0606e3e3b129d
Author: Andrew Or <[email protected]>
Date: 2016-04-06T22:13:08Z
Implement drop partitions
commit cccc66914aa9a379183a2fca7181dbae03907d0d
Author: Andrew Or <[email protected]>
Date: 2016-04-06T22:14:31Z
Throw exception for touch/compact/concatenate
commit cdbf251d06a19c3656b7d93f390418c685dd85c2
Author: Andrew Or <[email protected]>
Date: 2016-04-06T22:20:15Z
Implement rename partition
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]