BigQuery scripting and stored procedures are generally available Since March 30, 2020. It’s powerful feature for complex transformations. Is there a way to invoke the BigQuery scripts/Stored procedures through dbt?
dbt doesn’t have any special features directly around stored procedures/scripts, but since they can be declared and invoked in SQL it should be pretty straightforward.
I’d probably write a macro that does a
CREATE OR REPLACE PROCEDURE {{ target.schema }}.my_procedure(...
and use either dbt run-operation
or on-run-start
hooks to call it.
Then use the procedure in the model SQL.
@jake thanks for the answer