Jaden-Varkey opened a new pull request, #2969:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2969

   Fixes #2049 (and downstream apache/datafusion#17802).
   
   With projection trailing commas enabled (e.g. `GenericDialect`), this fails 
since 0.58:
   
       SELECT 'a' AS a, offset FROM t  -- Expected: end of statement, found: t
   
   After a comma, any keyword reserved for column aliases (`OFFSET`, `LIMIT`, 
...) was treated as the start of a clause after a trailing comma. The 
projection now treats the keyword as a select item when it is followed by `,`, 
`FROM` or `AS`. Real trailing commas (`SELECT a, FROM t`, `SELECT a, LIMIT 1`) 
are unchanged. The keyword-at-EOF case (`SELECT a, offset`) is left as is, 
since existing tests expect `SELECT 1, <KW>` to be a trailing comma.
   
   Tests: `parse_projection_trailing_comma_keyword_column` in 
`sqlparser_common.rs`, plus a fuzz seed.
   
   AI-assisted (Claude).
   


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