# Using dbt to manage user defined functions

**URL:** <https://discourse.getdbt.com/t/using-dbt-to-manage-user-defined-functions/18>\
**Category:** Show and Tell\
**Tags:** udf\
**Created:** [April 19, 2018, 2:20am UTC](https://discourse.getdbt.com/t/using-dbt-to-manage-user-defined-functions/18 "2018-04-19T02:20:22Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![jars](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/jars/32/127_2.png) [@jars](https://discourse.getdbt.com/u/jars)\
**Post date:** [July 18, 2019, 7:48am UTC](https://discourse.getdbt.com/t/using-dbt-to-manage-user-defined-functions/18/9 "2019-07-18T07:48:48Z")

</div>

@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!

---

_[View the full topic](https://discourse.getdbt.com/t/using-dbt-to-manage-user-defined-functions/18)._
