Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] JSQLParser 4.6 : Redshift : CREATE MATERIALIZED VIEW with BACKUP NO is not supported #1735

Open
zaza opened this issue Feb 24, 2023 · 1 comment
Labels
DDL DDL statement related

Comments

@zaza
Copy link
Contributor

zaza commented Feb 24, 2023

Parsing the following line fails with an error.

CREATE MATERIALIZED VIEW myview BACKUP NO AS SELECT * FROM mytab

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

Was expecting one of:

    "ALTER"
    "ANALYZE"
    "CALL"
    "COMMENT"
    "COMMIT"
    "DECLARE"
    "DESCRIBE"
    "DROP"
    "EXEC"
    "EXECUTE"
    "EXPLAIN"
    "GRANT"
    "PURGE"
    "RENAME"
    "RESET"
    "ROLLBACK"
    "SAVEPOINT"
    "SET"
    "SHOW"
    "TRUNCATE"
    "USE"

	at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:38866)
	at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:38696)
	at net.sf.jsqlparser.parser.CCJSqlParser.SingleStatement(CCJSqlParser.java:517)
	at net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:285)
	at net.sf.jsqlparser.parser.CCJSqlParserUtil$1.call(CCJSqlParserUtil.java:253)
	at net.sf.jsqlparser.parser.CCJSqlParserUtil$1.call(CCJSqlParserUtil.java:1)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

Tried with JSqlParser 4.6/master. The BACKUP clause is available in Redshift to control if the view is to be included in snapshots.

@zaza zaza changed the title CREATE MATERIALIZED VIEW with BACKUP NO is not supported [BUG] JSQLParser 4.6 : Redshift : CREATE MATERIALIZED VIEW with BACKUP NO is not supported Feb 24, 2023
@wumpz
Copy link
Member

wumpz commented Mar 9, 2023

This is not supported. PRs are welcome.

@manticore-projects manticore-projects added the DDL DDL statement related label Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DDL DDL statement related
Projects
None yet
Development

No branches or pull requests

3 participants