BenSatori opened a new pull request, #3093: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/3093
Dialects: Oracle `SELECT c.id FROM customers SAMPLE (2) c WHERE c.id >= 0` currently fails with: `Expected: end of statement, found: c` Oracle writes the sample clause before the table alias (`t SAMPLE [BLOCK] (n) [SEED (n)] alias`). The parser already supports this placement through `Dialect::supports_table_sample_before_alias` (used by Hive). This PR enables it for `OracleDialect`. As a result, `FROM t x SAMPLE (2)`, with the sample after the alias, is now rejected for Oracle, which matches Oracle's grammar. Syntax reference: https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/SELECT.html Out of scope: using `sample` itself as a table alias (`FROM t sample`). SAMPLE is reserved as a table alias for all dialects, and lifting that for Oracle is a separate dialect decision. Happy to follow up, or fold it in here if you prefer. Fuzzed with `fuzz_parse_sql` and `fuzz_parse_roundtrip` for 60 seconds each, no new panics. Seed: `fuzz/fuzz_seeds/oracle_table_sample_before_alias.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]
