google / zetasql

ZetaSQL - Analyzer Framework for SQL
Apache License 2.0
2.28k stars 214 forks source link

Spanner Dialect - ALTER INDEX Unexpected Error #147

Open SDorgan opened 1 year ago

SDorgan commented 1 year ago

Hello, According to documentation, the ALTER INDEX statement should follow this example:

ALTER INDEX index_name {ADD|DROP} STORED COLUMN column_name

Reference: https://cloud.google.com/spanner/docs/secondary-indexes#googlesql_5

That said, while trying out the parser in the following piece of code

String query = <My script>;
LanguageOptions languageOptions = new LanguageOptions();
ASTNodes.ASTScript parsedScript = Parser.parseScript(query, languageOptions);

I found that:

The Parser returns: Unexpected keyword STORED [at 1:21]

The Parser returns: ALTER INDEX is not supported [at 1:7]

The Parser returns: Unexpected ";" [at 1:33]

The Parser returns: Unexpected keyword STORED [at 1:20]

I was wondering if this was the expected result and if ALTER INDEX will be supported in the future. Thanks