cloud-fan commented on code in PR #60353:
URL: https://github.com/apache/spark/pull/60353#discussion_r4589755899


##########
sql/api/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseParser.g4:
##########
@@ -83,7 +83,9 @@ options { tokenVocab = SqlBaseLexer; }
            la == ANTI || la == ASOF || la == JOIN || la == UNION || la == 
EXCEPT ||
            la == SETMINUS || la == INTERSECT || la == ORDER || la == CLUSTER ||
            la == DISTRIBUTE || la == SORT || la == LIMIT || la == OFFSET ||
-           la == AGGREGATE || la == WINDOW || la == LATERAL || la == BIN;
+           la == AGGREGATE || la == WINDOW || la == LATERAL || la == BIN ||
+           // GAP starts a pipe step only before FILL (, so `a | gap` stays a 
bitwise OR.
+           (la == GAP && _input.LA(3) == FILL && _input.LA(4) == LEFT_PAREN);

Review Comment:
   Thanks, confirmed. `isOperatorPipeStart()` in SqlBaseParser.g4 (lines 86-88) 
now also requires PARTITION or ORDER followed by BY after `GAP FILL (`, so an 
inline-table row ending in `| gap` followed by the alias `fill(a)` parses as on 
the base branch, and the new PlanParserSuite test covers these alias forms in 
both keyword modes.
   
   <!-- SPARK_DEV_REVIEW_REPLY 
{"feedback_id":"inline:4588608920","thread_id":"inline:4588608920","verdict_sha256":"0e4a9cd77791f7c05600df09c65fd17b4a5778039c9da4d21b6fa951a3d99fd8"}
 -->



##########
sql/api/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBaseParser.g4:
##########
@@ -1331,6 +1367,7 @@ relationExtension
     | pivotClause
     | unpivotClause
     | binByClause
+    | gapFillClause

Review Comment:
   Thanks, confirmed. The PR description now states the extra first-stage 
lookahead when gap is used as a name where a GAP FILL clause could start, and 
why GAP stays non-reserved.
   
   <!-- SPARK_DEV_REVIEW_REPLY 
{"feedback_id":"inline:4588608934","thread_id":"inline:4588608934","verdict_sha256":"0e4a9cd77791f7c05600df09c65fd17b4a5778039c9da4d21b6fa951a3d99fd8"}
 -->



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