dtenedor commented on code in PR #48093: URL: https://github.com/apache/spark/pull/48093#discussion_r1779352501
########## sql/api/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseParser.g4: ########## @@ -1493,6 +1493,8 @@ version operatorPipeRightSide : selectClause | whereClause + | pivotClause? unpivotClause? Review Comment: Good question. I originally did that, but we wanted to return descriptive error messages if the query erroneously includes both the PIVOT and UNPIVOT clauses consecutively (this is not allowed). I updated this to ``` | pivotClause unpivotClause? | unpivotClause pivotClause? ``` and added a comment ``` // The following two cases match the PIVOT or UNPIVOT clause, respectively. // For each one, we add the other clause as an option in order to return high-quality // error messages in the event that both are present (this is not allowed). ``` Hopefully this helps 👍 -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org