Angryrou commented on code in PR #48649:
URL: https://github.com/apache/spark/pull/48649#discussion_r1831675014


##########
sql/api/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseParser.g4:
##########
@@ -1502,8 +1502,11 @@ version
     ;
 
 operatorPipeRightSide
-    : selectClause
-    | whereClause
+    : selectClause windowClause?
+    // Note that the WINDOW clause is not allowed in the WHERE pipe operator, 
but we add it here in
+    // the grammar simply for purposes of catching this invalid syntax and 
throwing a specific
+    // dedicated error message.
+    | whereClause windowClause?

Review Comment:
   According to @dtenedor Danial's offline discussion with Jeff Shute from the 
original research paper [1], we shall add the WINDOW clause as an optional 
operator at the end of existing operators that support expressions such as 
SELECT and WHERE. 
   
   > We find that having |> WINDOW as a separate pipe operator breaks the 
composability of the operators. Therefore, we should actually add the WINDOW 
clause as optional at the end of existing operators that support expressions, 
like |> SELECT and |> WHERE.



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