This is the process I used to put redshift user defined functions into dbt.
- Created a subdirectory:
macros/udfs/ - Created a file for each udf, e.g.
macros/udfs/f_future_date.sql.
{% macro f_future_date() %}
CREATE OR REPLACE FUNCTION {{target.schema}}.f_future_date()
RETURNS TIMESTAMP
IMMUTABLE AS $$
SELECT '2100-01-01'::TIMESTAMP;