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

 ##########
 File path: 
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
 ##########
 @@ -172,20 +175,20 @@ statement
     | DROP TEMPORARY? FUNCTION (IF EXISTS)? qualifiedName              
#dropFunction
     | EXPLAIN (LOGICAL | FORMATTED | EXTENDED | CODEGEN | COST)?
         statement                                                      #explain
-    | SHOW TABLES ((FROM | IN) db=identifier)?
+    | SHOW TABLES ((FROM | IN) db=errorCapturingIdentifier)?
         (LIKE? pattern=STRING)?                                        
#showTables
-    | SHOW TABLE EXTENDED ((FROM | IN) db=identifier)?
+    | SHOW TABLE EXTENDED ((FROM | IN) db=errorCapturingIdentifier)?
         LIKE pattern=STRING partitionSpec?                             
#showTable
     | SHOW TBLPROPERTIES table=tableIdentifier
         ('(' key=tablePropertyKey ')')?                                
#showTblProperties
     | SHOW COLUMNS (FROM | IN) tableIdentifier
-        ((FROM | IN) db=identifier)?                                   
#showColumns
+        ((FROM | IN) db=errorCapturingIdentifier)?                     
#showColumns
     | SHOW PARTITIONS tableIdentifier partitionSpec?                   
#showPartitions
-    | SHOW identifier? FUNCTIONS
+    | SHOW func=errorCapturingIdentifier? FUNCTIONS
         (LIKE? (qualifiedName | pattern=STRING))?                      
#showFunctions
     | SHOW CREATE TABLE tableIdentifier                                
#showCreateTable
     | (DESC | DESCRIBE) FUNCTION EXTENDED? describeFuncName            
#describeFunction
-    | (DESC | DESCRIBE) database EXTENDED? identifier                  
#describeDatabase
+    | (DESC | DESCRIBE) database EXTENDED? db=errorCapturingIdentifier 
#describeDatabase
 
 Review comment:
   Test coverage for this?

----------------------------------------------------------------
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