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

   Dialects: Snowflake, Generic
   
   Closes #2895.
   
   `SELECT * RENAME (a AS b) REPLACE (a + 1 AS a) FROM (SELECT a FROM t)` 
failed with `sql parser error: Expected: end of statement, found: REPLACE`, 
because `parse_wildcard_additional_options` parsed the wildcard options in a 
single fixed-order pass.
   
   This parses `REPLACE` and `RENAME` in a loop so either order is accepted; a 
repeated option is still rejected. The parsed AST stringifies to the canonical 
REPLACE-first form.
   
   Tests: new `test_select_wildcard_with_rename_before_replace` in 
`tests/sqlparser_snowflake.rs` (both orders produce the same AST; a repeated 
`REPLACE` still errors), the reversed-order error assertion is removed from 
`test_select_wildcard_with_replace_and_rename`, and a fuzz seed is added. 
`cargo test --all-features`, `cargo fmt --all`, and `cargo clippy --all-targets 
--all-features -- -D warnings` all pass.
   
   Snowflake syntax: 
https://docs.snowflake.com/en/sql-reference/sql/select#parameters
   
   Disclosure: this change was prepared with AI assistance (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