GitHub user windpiger opened a pull request:
https://github.com/apache/spark/pull/17721
[SPARK-20013][SQL]merge renameTable to alterTable in ExternalCatalog
## What changes were proposed in this pull request?
merge renameTable to alterTable in ExternalCatalog has some reasons:
In Hive, we rename a Table by alterTable
Currently when we create / rename a managed table, we should get the
defaultTablePath for them in ExternalCatalog, then we have two defaultTablePath
logic in its two subclass HiveExternalCatalog and InMemoryCatalog, additionally
there is also a defaultTablePath in SessionCatalog, so till now we have three
defaultTablePath in three classes.
we'd better to unify them up to SessionCatalog
To unify them, we should move some logic from ExternalCatalog to
SessionCatalog, renameTable is one of this.
while limit to the simple parameters in renameTable
```
def renameTable(db: String, oldName: String, newName: String): Unit
```
even if we move the defaultTablePath logic to SessionCatalog, we can not
pass it to renameTable.
So we can merge the renameTable to alterTable, and rename it in alterTable.
## How was this patch tested?
delete some tests in ExternalCatalogSuite which already existed in
SessionCatalogSuite,
and move some other tests in ExternalCatalogSuite which does not exist in
SessionCatalogSuite
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/windpiger/spark mergeAlterRenameTable
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/17721.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 #17721
commit 2ea645c6efef36ad2833d8eced0150d4062b1efd
Author: windpiger
Date: 2017-04-21T14:52:30Z
[SPARK-20013][SQL]merge renameTable to alterTable in ExternalCatalog
---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---
-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org