-
Notifications
You must be signed in to change notification settings - Fork 219
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
Analyze queries with DECLARE #139
Comments
It's often helpful to provide some context when requesting help. But, to answer your question as best I can. Yes, the analyzer supports queries that contain DECLARE statements. |
Thanks for the reply, and sorry I should have included more details. I am following the AnalyzeBigQuery.java file here: https://github.com/GoogleCloudPlatform/professional-services/blob/main/tools/zetasql-helper/zetasql-toolkit-examples/src/main/java/com/google/zetasql/toolkit/examples/AnalyzeBigQuery.java and trying to make it work with a modified query that contains a DECLARE statement: DECLARE my_title STRING DEFAULT 'Unrestricted submarine warfare'; Everything builds fine and the original files example files run without issues, but once I include the DECLARE keyword I get the following error: Exception in thread "main" com.google.zetasql.SqlException: Syntax error: Unexpected keyword DECLARE [at 1:1] Furthermore I am running this within the Google Cloud Shell. I suspect that I need to add the declared variable to the bigquery catalog but am unsure how to do so, any help would be much appreciated! |
DECLARE statements are considered a part of script in Bigquery. That's not supported in Zetasql currently. Though I also tried finding how to add a constant in a simple catalog but could not find how to do it. |
Does the analyzer support queries that contain DECLARE statements? Im getting "unexpected token: DECLARE" errors when running it.
The text was updated successfully, but these errors were encountered: