Skip to content

Redshift MATERIALIZED VIEW with AUTO REFRESH is not supported #1684

Closed
@zaza

Description

@zaza

Using the "AUTO REFRESH" clause for a materialized view in Redshift is not supported by JSqlParser.

Trying to parse a statement like this:
CREATE MATERIALIZED VIEW AUTO REFRESH YES foo AS SELECT * FROM bar
results in:

net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "CREATE" "CREATE"
    at line 1, column 1.

Was expecting one of:

    "("
    "ALTER"
    "CALL"
    "COMMENT"
    "COMMIT"
    "DECLARE"
    "DELETE"
    "DESCRIBE"
    "DROP"
    "EXEC"
    "EXECUTE"
    "EXPLAIN"
    "GRANT"
    "INSERT"
    "MERGE"
    "PURGE"
    "RENAME"
    "RESET"
    "ROLLBACK"
    "SAVEPOINT"
    "SET"
    "SHOW"
    "TRUNCATE"
    "UPDATE"
    "UPSERT"
    "USE"
    "VALUES"
    "WITH"
    <K_SELECT>

	at app//net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:190)
	at app//net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:63)
	at app//net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:38)
	... 86 more
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "CREATE" "CREATE"
    at line 1, column 1.

With the AUTO REFRESH YES clause removed the statement is parsed just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions