create udfs

This commit is contained in:
drethereum 2023-05-22 17:25:28 -06:00
parent 84a954d74e
commit 408192bf65

View File

@ -1,17 +1,13 @@
{% macro create_udfs(drop_=False) %}
{% if var("UPDATE_UDFS_AND_SPS") %}
{% set name %}
{{- udf_configs() -}}
{{- reference_models.udf_configs() -}}
{% endset %}
{% set udfs = fromyaml(name) %}
{% set sql %}
CREATE schema if NOT EXISTS silver;
CREATE schema if NOT EXISTS utils;
CREATE schema if NOT EXISTS _utils;
CREATE schema if NOT EXISTS _live;
CREATE schema if NOT EXISTS live;
{%- for udf in udfs -%}
{{- create_or_drop_function_from_config(udf, drop_=drop_) -}}
{{- reference_models.create_or_drop_function_from_config(udf, drop_=drop_) -}}
{% endfor %}
{% endset %}
{% do run_query(sql) %}