ZdravDim commented on code in PR #60353:
URL: https://github.com/apache/spark/pull/60353#discussion_r4589082481


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

Review Comment:
   Agreed, the PR description now says that using gap as a name where GAP FILL 
could start costs a few more tokens of first-stage lookahead with the same 
result, as BIN already does, and that GAP stays non-reserved so existing names 
keep working.



##########
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:
   Fixed, the check now also needs PARTITION or ORDER and then BY after the 
parenthesis, so `VALUES 1 | gap fill(a)` and the other alias forms parse as on 
the base branch in both keyword modes, and a new `PlanParserSuite` test covers 
them.



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