srielau commented on code in PR #38713:
URL: https://github.com/apache/spark/pull/38713#discussion_r1026672022


##########
sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseParser.g4:
##########
@@ -697,12 +697,12 @@ setQuantifier
     ;
 
 relation
-    : LATERAL? relationPrimary joinRelation*
+    : LATERAL? relationPrimary pivotClause? unpivotClause? joinRelation*
     ;
 
 joinRelation
-    : (joinType) JOIN LATERAL? right=relationPrimary joinCriteria?
-    | NATURAL joinType JOIN LATERAL? right=relationPrimary
+    : (joinType) JOIN LATERAL? right=relationPrimary joinCriteria? 
pivotClause? unpivotClause?
+    | NATURAL joinType JOIN LATERAL? right=relationPrimary pivotClause? 
unpivotClause?

Review Comment:
   Have you tried simply:
   ```suggestion
       : (joinType) JOIN LATERAL? right=relationPrimary joinCriteria?
       | NATURAL joinType JOIN LATERAL? right=relationPrimary
       | pivotClause
       | unpivotClause
   ```
   
   Also removing the relation entries above?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to