Skip to content

Conversation

@QMalcolm
Copy link
Contributor

resolves #1345

Problem

dbt-core added the ability to set function node volatility in dbt-labs/dbt-core#12100. Thus in adapters we needed to begin interpolating the correct volatility value into the function materialization macros.

Solution

  • Create new macros for interpolating volatility for a given function node
  • Test that the volatility gets set (and still successfully creates the function)

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

{% if model.config.get('volatility') == 'deterministic' %}
IMMUTABLE
{% elif model.config.get('volatility') == 'stable' %}
{% do exceptions.raise_compiler_error("`Stable` function volatility is not supported for Snowflake") %}
Copy link
Contributor Author

@QMalcolm QMalcolm Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively we could

  • Ignore stable
  • Raise a warning

The benefit of doing so would be that switching a project from another data warehouse to snowflake wouldn't break functions declared "stable". The drawback of not raising an error is that a user might set stable for a function in snowflake, think doing so is doing so does something, but it doesn't 🤔
cc: @graciegoheen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relatedly, in dbt-bigquery we're just ignoring volatility. What we decided to do with stable in dbt-snowflake is also what we should do with any volatility setting in dbt-bigquery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:yes The PR author has signed the CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UDFs] A function's volatility is propagated to the create/replace function logic

2 participants