-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
P2UDFsWork related to UDFsWork related to UDFsuser docs[docs.getdbt.com] Needs better documentation[docs.getdbt.com] Needs better documentation
Milestone
Description
Housekeeping
- I am a maintainer of dbt-core
Short description
Data warehouses have a general concept of volatility when defining UDFs. Defining a function's volatility lets the data warehouse do some optimizations when executing the function.
- Snowflake uses
VOLATILE
/IMMUTABLE
(default isVOLATILE
)[docs] - Redshift uses
VOLATILE
/STABLE
/IMMUTABLE
(default isVOLATILE
)[docs] - BigQuery does not support this (it infers it as best it can)
- databricks use
DETERMINISTIC
(assumed nondeterministic unless declared)[docs]
Acceptance criteria
- A
volatility
can be declared in a function's config - By default the
volatility
of a function isNone
- A
volatility can be defined as
deterministic,
stable,
non-deterministic, or
None`
These next two should be moved the dbt-adapters related issue once it exists
- If a
volatility
is specified for a function, then the create function statement run against the data warehouse uses the appropriate volatility keyword - If
volatility
isNone
for a function, then no volatility keyword is used in the create function statement run against the data warehouse.
Suggested Tests
Can specify a volatility
Impact to Other Teams
N/A
Will backports be required?
No
Context
No response
Metadata
Metadata
Assignees
Labels
P2UDFsWork related to UDFsWork related to UDFsuser docs[docs.getdbt.com] Needs better documentation[docs.getdbt.com] Needs better documentation