spark-test commented on PR #60353:
URL: https://github.com/apache/spark/pull/60353#issuecomment-6871104679

   Thanks for looking into the duplicate-clause checks. They count only the GAP 
FILL clause's own tokens: `ctx.ALIGN`, `ctx.FROM`, `ctx.MAX`, `ctx.BIN_START` 
and `ctx.IS_GENERATED` are generated as `getTokens(...)`, and in the ANTLR 
4.13.1 runtime that Spark uses, `ParserRuleContext.getTokens` looks only at the 
context's direct children, not its subtree. A keyword used as an alias or 
inside an expression sits under a nested identifier or expression context, so 
it is not counted. I checked this with a parser generated from this PR's 
grammar. In both keyword modes, `BIN_START AS bin_start`, `IS_GENERATED AS 
is_generated`, `ALIGN TO align`, `MAX GAP max`, `MAX GAP max(ts)` and `FROM ts 
TO ts + INTERVAL '1' DAY ALIGN TO EXTRACT(YEAR FROM ts)` each count their 
clause once. A clause written twice counts twice, so only real repeats raise 
DUPLICATE_CLAUSES. Those cases would still make good tests that expect no 
error. On the conf doc, the current text already says the operator is under 
devel
 opment and that GAP FILL queries are rejected whatever the value.
   
   <!-- SPARK_DEV_REVIEW_REPLY 
{"feedback_id":"conversation:6869594120","thread_id":"conversation:6869594120","verdict_sha256":"a940a435fec024843d11d38045319cfb93e2a17431195ba59f88c1a007e93ac2"}
 -->


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