You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by sr...@apache.org on 2019/03/21 11:41:21 UTC

[spark] branch master updated: [MINOR][SQL] Put the grammar of database together, because this is good for maintenance and readability.

This is an automated email from the ASF dual-hosted git repository.

srowen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 22c9ed6  [MINOR][SQL] Put the grammar of database together, because this is good for maintenance and readability.
22c9ed6 is described below

commit 22c9ed6a9c1428137a2a56c323d79b0c8442ffcf
Author: gengjiaan <ge...@360.cn>
AuthorDate: Thu Mar 21 06:41:04 2019 -0500

    [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 #24138 from beliefer/arrange-sql-grammar.
    
    Authored-by: gengjiaan <ge...@360.cn>
    Signed-off-by: Sean Owen <se...@databricks.com>
---
 .../src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 77d30fb..8bd7df5 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
@@ -83,6 +83,7 @@ statement
         (WITH DBPROPERTIES tablePropertyList)?                         #createDatabase
     | ALTER database identifier SET DBPROPERTIES tablePropertyList     #setDatabaseProperties
     | DROP database (IF EXISTS)? identifier (RESTRICT | CASCADE)?      #dropDatabase
+    | SHOW DATABASES (LIKE? pattern=STRING)?                           #showDatabases
     | createTableHeader ('(' colTypeList ')')? tableProvider
         ((OPTIONS options=tablePropertyList) |
         (PARTITIONED BY partitionColumnNames=identifierList) |
@@ -153,7 +154,6 @@ statement
         (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
     | SHOW COLUMNS (FROM | IN) tableIdentifier


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org