yeshengm commented on a change in pull request #24749: [SPARK-27890][SQL] 
Improve SQL parser error message for identifier with hyphens except those in 
expressions
URL: https://github.com/apache/spark/pull/24749#discussion_r290588408
 
 

 ##########
 File path: 
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
 ##########
 @@ -82,13 +82,15 @@ singleTableSchema
 statement
     : query                                                            
#statementDefault
     | ctes? dmlStatementNoWith                                         
#dmlStatement
-    | USE db=identifier                                                #use
-    | CREATE database (IF NOT EXISTS)? identifier
+    | USE db=errorCapturingIdentifier                                  #use
+    | CREATE database (IF NOT EXISTS)? errorCapturingIdentifier
         ((COMMENT comment=STRING) |
          locationSpec |
          (WITH DBPROPERTIES tablePropertyList))*                       
#createDatabase
-    | ALTER database identifier SET DBPROPERTIES tablePropertyList     
#setDatabaseProperties
-    | DROP database (IF EXISTS)? identifier (RESTRICT | CASCADE)?      
#dropDatabase
+    | ALTER database errorCapturingIdentifier
+        SET DBPROPERTIES tablePropertyList                             
#setDatabaseProperties
+    | DROP database (IF EXISTS)? db=errorCapturingIdentifier
 
 Review comment:
   done

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to