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

Validate BigQuery Script with Zetasql #131

Open
Longxiang-Bai opened this issue Feb 8, 2023 · 2 comments
Open

Validate BigQuery Script with Zetasql #131

Longxiang-Bai opened this issue Feb 8, 2023 · 2 comments

Comments

@Longxiang-Bai
Copy link

Hi, we have been using zetasql analyzer to validate our generated sql statement for BigQuery. Recently we have decided to generate multi-statement sql like:

BEGIN 
CREATE TEMP TABLE TempTable1(columnName STRING) AS select columnName from projectId.dataset.tableName where (((partitionColumn >= '2022-12-31') and (partitionColumn < '2023-01-03')) and ((localDatetimeColumn >= '2023-1-1') and (localDatetimeColumn < '2023-1-2')));
CREATE TEMP TABLE TempTable2(columnName STRING) AS select columnName from TempTable1 where (upper(CompanyGuid) in ('COMPANYGUID') and GroupId in ('groupId'));
select columnName from TempTable2 where DeviceId in ('deviceId') limit 1;
END

But we failed to validate the above statement with zetasql with following config:

LanguageOptions languageOptions = new LanguageOptions();
languageOptions.supportsStatementKind(ZetaSQLResolvedNodeKind.ResolvedNodeKind.RESOLVED_QUERY_STMT);
languageOptions.supportsStatementKind(ZetaSQLResolvedNodeKind.ResolvedNodeKind.RESOLVED_CREATE_TABLE_AS_SELECT_STMT);
languageOptions.enableMaximumLanguageFeatures();
AnalyzerOptions analyzerOptions = new AnalyzerOptions();
analyzerOptions.setLanguageOptions(languageOptions);
Analyzer.extractTableNamesFromScript(sql, analyzerOptions);

I am wondering if anyone could advise? Thanks!

@masterlittle
Copy link

Zetasql doesn't support script parsing currently.

@Longxiang-Bai
Copy link
Author

@masterlittle thanks for your reply, I am wondering if there is any timeline or ETA for ZetaSql to support script parsing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants