Using .js files to generate queries from a template
#1616
Closed
brightbytes-dude
started this conversation in
General
Replies: 1 comment 3 replies
|
Ah, so I think you are trying to do something at compile-time which you can only actually do at run-time. Dataform code is "compiled" (really: "executed") to produce static SQL, i.e. all JavaScript is gone. Compilation is (by design) hermetic, i.e. your JavaScript cannot communicate with the outside world - including BigQuery. Later, the compiled SQL is then executed against BigQuery. I think you want to use BigQuery scripting (https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language) for this. You'd have (probably) an Unfortunately I cannot see a way of making those run in parallel. |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I couldn't Google an obvious answer to this, but there probably is one. Apologies if so.
I want to generate a large number of bulk-load BQ Federation queries to run in parallel in a
.jsfile.I pull the CloudSQL info schema into a BQ dataform table like so:
ods_info_schema.sqlxNow, I want to use the entire contents of that table as the array for a
forEachin the following file:federation.jsMy guess is that I probably need to use a JS library to pull in the table contents as an array, but I was hoping for a native way to do it in Dataform.
Thanks for any help you can provide!
All reactions