Skip to content

Commit 22c9ed6

Browse files
beliefersrowen
authored andcommitted
[MINOR][SQL] Put the grammar of database together, because this is good for maintenance and readability.
## What changes were proposed in this pull request? The SQL grammar `SHOW DATABASES` is mixed in some grammar of table. I think should arrange the grammar of database together. This is good for maintenance and readability. ## How was this patch tested? No UT Closes apache#24138 from beliefer/arrange-sql-grammar. Authored-by: gengjiaan <[email protected]> Signed-off-by: Sean Owen <[email protected]>
1 parent be08b41 commit 22c9ed6

File tree

1 file changed

+1
-1
lines changed
  • sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser

1 file changed

+1
-1
lines changed

sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ statement
8383
(WITH DBPROPERTIES tablePropertyList)? #createDatabase
8484
| ALTER database identifier SET DBPROPERTIES tablePropertyList #setDatabaseProperties
8585
| DROP database (IF EXISTS)? identifier (RESTRICT | CASCADE)? #dropDatabase
86+
| SHOW DATABASES (LIKE? pattern=STRING)? #showDatabases
8687
| createTableHeader ('(' colTypeList ')')? tableProvider
8788
((OPTIONS options=tablePropertyList) |
8889
(PARTITIONED BY partitionColumnNames=identifierList) |
@@ -153,7 +154,6 @@ statement
153154
(LIKE? pattern=STRING)? #showTables
154155
| SHOW TABLE EXTENDED ((FROM | IN) db=identifier)?
155156
LIKE pattern=STRING partitionSpec? #showTable
156-
| SHOW DATABASES (LIKE? pattern=STRING)? #showDatabases
157157
| SHOW TBLPROPERTIES table=tableIdentifier
158158
('(' key=tablePropertyKey ')')? #showTblProperties
159159
| SHOW COLUMNS (FROM | IN) tableIdentifier

0 commit comments

Comments
 (0)