bvolpato opened a new pull request, #3017:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/3017
Dialects: Generic, Snowflake, Oracle, DuckDb
## Summary
This change fixes three `MATCH_RECOGNIZE` parsing gaps encountered while
building the `datafusion-match-recognize` DataFusion `RelationPlanner`
extension:
1. **Derived tables:** Allow `MATCH_RECOGNIZE` after derived tables (for
example `SELECT * FROM (SELECT ...) AS t MATCH_RECOGNIZE (...)` and `SELECT *
FROM (VALUES ...) AS t (id, tag) MATCH_RECOGNIZE (...)`), matching the existing
`PIVOT` and `UNPIVOT` handling on derived table factors.
2. **Unparenthesized exclusion lookahead:** In `parse_repetition_pattern`,
check that `Token::LBrace` is not followed by `Token::Minus` before treating
`{` as a `{n,m}` quantifier. Previously, `PATTERN (S1 {- S2 -}* S3)` failed
with `Expected: quantifier range, found: -`.
3. **Case-insensitive `PERMUTE`:** Accept `permute(...)` in addition to
uppercase `PERMUTE(...)` in `parse_base_pattern`.
No AST structs or enum variants change.
## Validation
- Ran `cargo fmt --all -- --check` and `cargo clippy --all-targets -- -D
warnings`.
- Ran `cargo test` across `sqlparser_common`, `sqlparser_snowflake`,
`sqlparser_postgres`, `sqlparser_duckdb`, and unit tests, including new
round-trip parser tests for derived tables, unparenthesized exclusions, and
lowercase `permute`.
--
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]