From a695e382dbca7fdf212fb74c0a641df27a3ede0b Mon Sep 17 00:00:00 2001 From: jonhopper-dataengineers Date: Thu, 25 Aug 2022 17:38:20 +1200 Subject: [PATCH] fixed up udf for string uses --- ...lake_create_user_defined_functions_statement.sql | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/macros/user_defined_functions/snowflake_create_user_defined_functions_statement.sql b/macros/user_defined_functions/snowflake_create_user_defined_functions_statement.sql index 2424afd..b0d92f4 100644 --- a/macros/user_defined_functions/snowflake_create_user_defined_functions_statement.sql +++ b/macros/user_defined_functions/snowflake_create_user_defined_functions_statement.sql @@ -9,6 +9,11 @@ RETURNS {{ return_type }} {% if preferred_language != 'sql' %} LANGUAGE {{ preferred_language }} {% endif %} +{% if immutable %} + IMMUTABLE +{% else %} + VOLATILE +{% endif %} {% if preferred_language == 'python' %} RUNTIME_VERSION = '{{ runtime_version }}' @@ -22,10 +27,8 @@ target_path = {{ target_path }} AS -{% if preferred_language != 'python' %} - '{{ sql }}' - {% else %} -{{ sql }} -{% endif %} +$$ + {{ sql }} + $$ ; {%- endmacro -%} \ No newline at end of file