@claire, I adapted your instructions for BQ tonight and it seems one of the BigQuery Persistent UDF limitations is that you cannot define more than one CREATE FUNCTION per call.
This is apparent even by using the BigQuery UI; BQ won’t let you execute two CREATE FUNCTION statements in the same query unless they are set as TEMPORARY.
As a result, I don’t think it’s possible to use a create_udfs()-like function for BigQuery since all UDF creation will get compiled and executed in a single call. For example, my error back from dbt run is:
Syntax error: Unexpected extra token CREATE at [7:1]
I haven’t tried it yet, but I suspect calling one macro for each array element of our dbt_project.yml's on-run-start hook should solve this, since it will (from my understanding) execute each singular CREATE FUNCTION in it’s own BQ request.
I will try it out tmrw!