yeshengm commented on a change in pull request #24809: [SPARK-21136][SQL] Fix 
confusing parsing error due to problematic antlr grammer for Hive-style 
single-from statements
URL: https://github.com/apache/spark/pull/24809#discussion_r291372343
 
 

 ##########
 File path: 
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
 ##########
 @@ -378,25 +378,20 @@ dmlStatementNoWith
     ;
 
 queryNoWith
-    : queryTerm queryOrganization                                              
 #noWithQuery
-    | fromClause selectStatement+                                              
 #queryWithFrom
+    : queryTerm queryOrganization
     ;
 
 queryOrganization
     : (ORDER BY order+=sortItem (',' order+=sortItem)*)?
       (CLUSTER BY clusterBy+=expression (',' clusterBy+=expression)*)?
       (DISTRIBUTE BY distributeBy+=expression (',' distributeBy+=expression)*)?
       (SORT BY sort+=sortItem (',' sort+=sortItem)*)?
-      windows?
+      windowClause?
       (LIMIT (ALL | limit=expression))?
     ;
 
 multiInsertQueryBody
-    : insertInto selectStatement
-    ;
-
-selectStatement
-    : querySpecification queryOrganization
+    : insertInto fromStatementBody
 
 Review comment:
   The clause can be either select/transform/map/reduce etc. Thus rename this 
to `fromStatementBody`.

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