Version
v4.5.1
Which SQL?
Trino
What happened?
Currently, the Trino SQL parser implementation in this repository is based on an older version of Trino SQL grammar. As specified in the grammar file comment:
* current version 450 (https://github.com/DTStack/dt-sql-parser/blob/main/src/grammar/trino/TrinoSql.g4#L18C4-L18C23)
Because of this, the parser lacks support for several new DDL statements introduced in later versions of Trino. Specifically, trying to validate or parse the ALTER VIEW ... REFRESH statement results in a syntax error.
TrinoSql.g4 grammar can be updated to support the ALTER VIEW view_name REFRESH statement.
According to the official Trino 477 Release Notes:
Proposed Grammar Changes (TrinoSql.g4):
- Add a new alternative rule to the
statement block:
statement
: ...
| KW_ALTER KW_VIEW from=viewRef KW_REFRESH # refreshView
| ...
;
(Alternatively, it can be named alterView if extracted into a separate rule).
- Ensure
REFRESH is registered as a keyword/lexer token if it's not fully global.
Additional context
This feature is highly required for correct parsing and auto-completion validation when working with Hive or Memory connectors in modern Trino clusters (v477+).
Version
v4.5.1
Which SQL?
Trino
What happened?
Currently, the Trino SQL parser implementation in this repository is based on an older version of Trino SQL grammar. As specified in the grammar file comment:
Because of this, the parser lacks support for several new DDL statements introduced in later versions of Trino. Specifically, trying to validate or parse the
ALTER VIEW ... REFRESHstatement results in a syntax error.TrinoSql.g4grammar can be updated to support theALTER VIEW view_name REFRESHstatement.According to the official Trino 477 Release Notes:
Proposed Grammar Changes (
TrinoSql.g4):statementblock:(Alternatively, it can be named
alterViewif extracted into a separate rule).REFRESHis registered as a keyword/lexer token if it's not fully global.Additional context
This feature is highly required for correct parsing and auto-completion validation when working with Hive or Memory connectors in modern Trino clusters (v477+).