-
- Downloads
[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`. Add new test case in `DDLSuite`. Author: jiangxingbo <jiangxb1987@gmail.com> Closes #16373 from jiangxb1987/show-partition-extended.
Showing
- sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala 2 additions, 2 deletions...scala/org/apache/spark/sql/execution/QueryExecution.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala 5 additions, 6 deletions...scala/org/apache/spark/sql/execution/SparkSqlParser.scala
- sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala 31 additions, 13 deletions...scala/org/apache/spark/sql/execution/command/tables.scala
- sql/core/src/test/resources/sql-tests/inputs/show-tables.sql 13 additions, 2 deletionssql/core/src/test/resources/sql-tests/inputs/show-tables.sql
- sql/core/src/test/resources/sql-tests/results/show-tables.sql.out 108 additions, 25 deletions.../src/test/resources/sql-tests/results/show-tables.sql.out
- sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala 4 additions, 1 deletion...c/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala
- sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala 0 additions, 34 deletions...ala/org/apache/spark/sql/execution/command/DDLSuite.scala
Loading
Please register or sign in to comment