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

   Dialects: Oracle
   
   `SELECT UNIQUE c.id FROM customers c ORDER BY c.id` currently fails with:
   `Expected: end of statement, found: . at Line: 1, Column: 16`
   
   Oracle accepts `UNIQUE` as a synonym of `DISTINCT` in the select list. 
Syntax reference:
   
https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/SELECT.html
   
   This PR adds `Dialect::supports_select_unique()` (default `false`, `true` 
for `OracleDialect`). `UNIQUE` parses as `Distinct::Distinct` and displays as 
`DISTINCT`, matching how MySQL's `DISTINCTROW` is handled; no AST changes. 
`UNIQUE ALL` / `UNIQUE DISTINCT` are rejected, mirroring the existing `DISTINCT 
ALL` check.
   
   Tests in `tests/sqlparser_oracle.rs` cover the AST (`Distinct::Distinct`), 
display normalization (including lowercase, `ROWID ... AS` aliases, and 
subqueries), typed errors for the invalid combinations, and rejection in 
dialects without support.
   
   Fuzzed with `fuzz_parse_sql` and `fuzz_parse_roundtrip` for 60 seconds each, 
no panics. Seed: `fuzz/fuzz_seeds/oracle_select_unique.sql`.
   
   This PR was written with AI assistance (Claude Code). I reviewed every line 
and can explain each change.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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