VanshajPoonia opened a new pull request, #3092:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/3092

   Closes #3042
   
   Dialects: BigQuery
   
   BigQuery lets `|> SELECT` and `|> EXTEND` end with a `WINDOW name AS (...)` 
clause 
(https://cloud.google.com/bigquery/docs/reference/standard-sql/pipe-syntax#extend_pipe_operator).
 This failed before:
   
       SELECT * FROM t |> EXTEND sum(v) OVER w AS s WINDOW w AS (PARTITION BY k)
       -- Expected: end of statement, found: WINDOW
   
   `PipeOperator::Select` and `PipeOperator::Extend` now have a `named_window` 
field, the same as `Select::named_window`. The parser reuses 
`parse_named_window` after the select items and Display prints the clause back. 
Two public variants gain a field, so matches without `..` need the new field.
   
   One thing is left as is which is that if the last select item has no alias, 
`WINDOW` is read as its alias, the same as a plain `SELECT a WINDOW w AS (...)` 
on main today. Changing that touches the column alias rule for every dialect 
and that's why I would like to ask before doing it.
   
   AI disclosure: AI assistance was used to write the change and the tests. I 
read the whole diff and checked the tests fail without the fix and wrote this 
PR description myself.


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