Skip to content

Commit ae2adcd

Browse files
committed
Code review - thanks simon
1 parent c710eb0 commit ae2adcd

File tree

1 file changed

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

1 file changed

+9
-4
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ singleTableSchema
7878
statement
7979
: query #statementDefault
8080
| USE db=identifier #use
81-
| CREATE DATABASE (IF NOT EXISTS)? identifier
81+
| CREATE database (IF NOT EXISTS)? identifier
8282
(COMMENT comment=STRING)? locationSpec?
8383
(WITH DBPROPERTIES tablePropertyList)? #createDatabase
84-
| ALTER DATABASE identifier SET DBPROPERTIES tablePropertyList #setDatabaseProperties
85-
| DROP DATABASE (IF EXISTS)? identifier (RESTRICT | CASCADE)? #dropDatabase
84+
| ALTER database identifier SET DBPROPERTIES tablePropertyList #setDatabaseProperties
85+
| DROP database (IF EXISTS)? identifier (RESTRICT | CASCADE)? #dropDatabase
8686
| createTableHeader ('(' colTypeList ')')? tableProvider
8787
((OPTIONS options=tablePropertyList) |
8888
(PARTITIONED BY partitionColumnNames=identifierList) |
@@ -163,7 +163,7 @@ statement
163163
(LIKE? (qualifiedName | pattern=STRING))? #showFunctions
164164
| SHOW CREATE TABLE tableIdentifier #showCreateTable
165165
| (DESC | DESCRIBE) FUNCTION EXTENDED? describeFuncName #describeFunction
166-
| (DESC | DESCRIBE) DATABASE EXTENDED? identifier #describeDatabase
166+
| (DESC | DESCRIBE) database EXTENDED? identifier #describeDatabase
167167
| (DESC | DESCRIBE) TABLE? option=(EXTENDED | FORMATTED)?
168168
tableIdentifier partitionSpec? describeColName? #describeTable
169169
| REFRESH TABLE tableIdentifier #refreshTable
@@ -274,6 +274,11 @@ partitionVal
274274
: identifier (EQ constant)?
275275
;
276276

277+
database
278+
: DATABASE
279+
| SCHEMA
280+
;
281+
277282
describeFuncName
278283
: qualifiedName
279284
| STRING

0 commit comments

Comments
 (0)