Skip to content

Commit 4912fc0

Browse files
committed
Support volatility setting in dbt-redshift sql functions
1 parent fe15244 commit 4912fc0

File tree

1 file changed

+11
-0
lines changed
  • dbt-redshift/src/dbt/include/redshift/macros/materializations/functions

1 file changed

+11
-0
lines changed

dbt-redshift/src/dbt/include/redshift/macros/materializations/functions/scalar.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,14 @@
1414
{%- endfor %}
1515
{{ args | join(', ') }}
1616
{% endmacro %}
17+
18+
{% macro redshift__scalar_function_volatility_sql() %}
19+
{% if model.config.get('volatility') == 'deterministic' %}
20+
IMMUTABLE
21+
{% elif model.config.get('volatility') == 'stable' %}
22+
STABLE
23+
{% else %}
24+
{# At this point, either they've set `non-deterministic` or they've set nothing. In either case, we default to VOLATILE #}
25+
VOLATILE
26+
{% endif %}
27+
{% endmacro %}

0 commit comments

Comments
 (0)