coldsmirk opened a new pull request, #3008:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/3008
Dialects: Oracle
Oracle's flashback query clauses failed to parse:
SELECT * FROM emp AS OF SCN 17421273106698 e
-- Expected: end of statement, found: SCN at Line: 1, Column: 25
This adds the four forms of Oracle's `flashback_query_clause` as
`TableVersion::AsOf` and `TableVersion::VersionsBetween`, parsed behind a new
`Dialect::supports_flashback_query` that `OracleDialect` enables:
- `AS OF { SCN | TIMESTAMP } expr`, `AS OF PERIOD FOR column expr`
- `VERSIONS BETWEEN { SCN | TIMESTAMP } low AND high`, `VERSIONS PERIOD FOR
column BETWEEN low AND high` (a bound may be `MINVALUE` or `MAXVALUE`)
A table's version clause is now displayed where it is parsed, before the
alias, so `emp AS OF SCN 1 e` round-trips; before, a version and an alias
together were displayed alias first.
Syntax:
https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/SELECT.html
(`table_reference`, `flashback_query_clause`)
Related: #2006
Fuzzed with `fuzz_parse_sql` for 10 minutes, no panics.
This change was written with the help of an AI coding assistant; I reviewed
it and can explain every line.
--
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]