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

   Adds a `TrinoDialect` for 
[Trino](https://trino.io/docs/current/language.html), the distributed SQL 
engine that descends from Presto, and registers it as `"trino"` in 
`dialect_from_str`.
   
   Trino follows the SQL standard closely, so almost everything it needs is an 
existing opt-in hook. The dialect turns on:
   
   - double-quoted delimited identifiers only (backquotes are a syntax error in 
Trino, the most common mistake of users arriving from MySQL, ClickHouse or 
Spark)
   - `FILTER (WHERE ...)` on aggregates — 
https://trino.io/docs/current/sql/select.html#filter
   - `GROUP BY` expressions, `GROUPING SETS`, `CUBE`, `ROLLUP` — 
https://trino.io/docs/current/sql/select.html#group-by-clause
   - lambda expressions — https://trino.io/docs/current/functions/lambda.html
   - `MATCH_RECOGNIZE` — https://trino.io/docs/current/sql/match-recognize.html
   - table versioning (time travel) — 
https://trino.io/docs/current/connector/iceberg.html#time-travel-queries
   - parenthesized `EXPLAIN` options such as `EXPLAIN (TYPE IO, FORMAT JSON)` — 
https://trino.io/docs/current/sql/explain.html
   - `=>` named arguments to table functions — 
https://trino.io/docs/current/functions/table.html
   - `COMMENT ON` — https://trino.io/docs/current/sql/comment.html
   
   `tests/sqlparser_trino.rs` carries a corpus of 27 statements a Trino user 
writes daily (typed literals, `UNNEST WITH ORDINALITY`, `TABLESAMPLE`, `LISTAGG 
... WITHIN GROUP`, JSON path functions, `AT TIME ZONE`, `FETCH FIRST`, 
`SHOW`/`DESCRIBE`, ...), including a negative test that backquoted identifiers 
are rejected.
   
   Not covered here, on purpose, each a small follow-up:
   - the `FOR` prefix on `TIMESTAMP AS OF` / `VERSION AS OF` (a stacked PR 
follows this one)
   - `ROW(name type, ...)` types with named fields, which currently parse as a 
flat list on every dialect
   - inline `WITH FUNCTION ... RETURN` routines


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