aboutsummaryrefslogtreecommitdiff
path: root/sql/catalyst/src
diff options
context:
space:
mode:
authorjiangxingbo <jiangxb1987@gmail.com>2016-12-13 19:04:34 +0100
committerHerman van Hovell <hvanhovell@databricks.com>2016-12-13 19:04:34 +0100
commit5572ccf86b084eb5938fe62fd5d9973ec14d555d (patch)
tree6972e57022603e08687a2f2a4dcb1ae955ffefa5 /sql/catalyst/src
parentf280ccf449f62a00eb4042dfbcf7a0715850fd4c (diff)
downloadspark-5572ccf86b084eb5938fe62fd5d9973ec14d555d.tar.gz
spark-5572ccf86b084eb5938fe62fd5d9973ec14d555d.tar.bz2
spark-5572ccf86b084eb5938fe62fd5d9973ec14d555d.zip
[SPARK-17932][SQL][FOLLOWUP] Change statement `SHOW TABLES EXTENDED` to `SHOW TABLE EXTENDED`
## What changes were proposed in this pull request? Change the statement `SHOW TABLES [EXTENDED] [(IN|FROM) database_name] [[LIKE] 'identifier_with_wildcards'] [PARTITION(partition_spec)]` to the following statements: - SHOW TABLES [(IN|FROM) database_name] [[LIKE] 'identifier_with_wildcards'] - SHOW TABLE EXTENDED [(IN|FROM) database_name] LIKE 'identifier_with_wildcards' [PARTITION(partition_spec)] After this change, the statements `SHOW TABLE/SHOW TABLES` have the same syntax with that HIVE has. ## How was this patch tested? Modified the test sql file `show-tables.sql`; Modified the test suite `DDLSuite`. Author: jiangxingbo <jiangxb1987@gmail.com> Closes #16262 from jiangxb1987/show-table-extended.
Diffstat (limited to 'sql/catalyst/src')
-rw-r--r--sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g46
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4 b/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
index 075c73d7a3..63055b62d2 100644
--- a/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
+++ b/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
@@ -120,8 +120,10 @@ statement
(USING resource (',' resource)*)? #createFunction
| DROP TEMPORARY? FUNCTION (IF EXISTS)? qualifiedName #dropFunction
| EXPLAIN (LOGICAL | FORMATTED | EXTENDED | CODEGEN)? statement #explain
- | SHOW TABLES EXTENDED? ((FROM | IN) db=identifier)?
- (LIKE? pattern=STRING)? partitionSpec? #showTables
+ | SHOW TABLES ((FROM | IN) db=identifier)?
+ (LIKE? pattern=STRING)? #showTables
+ | SHOW TABLE EXTENDED ((FROM | IN) db=identifier)?
+ LIKE pattern=STRING partitionSpec? #showTable
| SHOW DATABASES (LIKE pattern=STRING)? #showDatabases
| SHOW TBLPROPERTIES table=tableIdentifier
('(' key=tablePropertyKey ')')? #showTblProperties