GitHub user jiangxb1987 opened a pull request:
https://github.com/apache/spark/pull/16373
[SPARK-18961][SQL] Support `SHOW TABLE EXTENDED ... PARTITION` statement
## What changes were proposed in this pull request?
We should support the statement `SHOW TABLE EXTENDED LIKE
'table_identifier' PARTITION(partition_spec)`, just like that HIVE does.
When partition is specified, the `SHOW TABLE EXTENDED` command should
output the information of the partitions instead of the tables.
Note that in this statement, we require exact matched partition spec. For
example:
```
CREATE TABLE show_t1(a String, b Int) PARTITIONED BY (c String, d String);
ALTER TABLE show_t1 ADD PARTITION (c='Us', d=1) PARTITION (c='Us', d=22);
-- Output the extended information of Partition(c='Us', d=1)
SHOW TABLE EXTENDED LIKE 'show_t1' PARTITION(c='Us', d=1);
-- Throw an AnalysisException
SHOW TABLE EXTENDED LIKE 'show_t1' PARTITION(c='Us');
```
## How was this patch tested?
Add new test sqls in file `show-tables.sql`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jiangxb1987/spark show-partition-extended
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/16373.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 #16373
----
commit d5ce86a2ef7f9833eb0a2b3c6859a17a998cfd59
Author: jiangxingbo <[email protected]>
Date: 2016-12-21T08:16:17Z
support SHOW TABLE EXTENDED ... PARTITION statement.
----
---
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]