{"record":{"id":"ba41229507500d4a","repo":"dbt-labs/dbt-core","slug":"volatility-is-not-supported-by-adapter-type-in","errorCode":null,"errorMessage":"Volatility is not supported by {adapter.type()} in javascript UDF and will be ignored","messagePattern":"Volatility is not supported by (.+?) in javascript UDF and will be ignored","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/dbt-loader/src/dbt_macro_assets/dbt-adapters/macros/materializations/functions/scalar.sql","lineNumber":64,"sourceCode":"{% macro default__scalar_function_body_sql() %}\n    $$\n       {{ model.compiled_code }}\n    $$ LANGUAGE SQL\n{% endmacro %}\n\n{% macro scalar_function_volatility_sql() %}\n    {{ return(adapter.dispatch('scalar_function_volatility_sql', 'dbt')()) }}\n{% endmacro %}\n\n{% macro scalar_function_volatility_javascript() %}\n    {{ return(adapter.dispatch('scalar_function_volatility_javascript', 'dbt')()) }}\n{% endmacro %}\n\n{% macro default__scalar_function_volatility_javascript() %}\n    {% set volatility = model.config.get('volatility') %}\n    {% if volatility != none %}\n        {% set msg = \"Volatility is not supported by \" ~ adapter.type() ~ \" in javascript UDF and will be ignored\" %}\n        {% do exceptions.warn(msg) %}\n    {% endif %}\n{% endmacro %}\n\n{% macro default__scalar_function_volatility_sql() %}\n    {% set volatility = model.config.get('volatility') %}\n    {% if volatility == 'deterministic' %}\n        IMMUTABLE\n    {% elif volatility == 'stable' %}\n        STABLE\n    {% elif volatility == 'non-deterministic' %}\n        VOLATILE\n    {% elif volatility != none %}\n        {# This shouldn't happen unless a new volatility is invented #}\n        {% do unsupported_volatility_warning(volatility) %}\n    {% endif %}\n    {# If no volatility is set, don't add anything and let the data warehouse default it #}\n{% endmacro %}\n","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/dbt-labs/dbt-core/blob/0267ce9170576975b76b64ce856b2e5848e96617/crates/dbt-loader/src/dbt_macro_assets/dbt-adapters/macros/materializations/functions/scalar.sql#L46-L82","documentation":"This warning comes from default__scalar_function_volatility_javascript, the adapter-dispatched macro for JavaScript UDFs. JavaScript UDFs on this adapter do not support volatility settings, so a user-specified `volatility` config on the function model cannot be applied and is silently ignored — dbt warns so the user knows the setting had no effect.","triggerScenarios":"A function materialization runs for a UDF written in JavaScript whose model config includes `volatility` (any non-none value, e.g. 'deterministic' or 'stable'); the default__scalar_function_volatility_javascript macro sees volatility != none and warns.","commonSituations":"Declaring volatility on a JS UDF copied from a SQL UDF config; migrating a SQL function to JavaScript while keeping the volatility config; multi-language function projects where only SQL functions support volatility.","solutions":["Remove the `volatility` config from the JavaScript function's model config, since it has no effect.","If determinism matters, move the function to SQL where volatility can be enforced, or document that JS UDFs are non-deterministic.","Leave it as a benign warning if the JS UDF's volatility truly doesn't matter for your use case."],"exampleFix":"// before\nconfig:\n  language: javascript\n  volatility: deterministic\n// after\nconfig:\n  language: javascript","handlingStrategy":"validation","validationCode":"# Only set volatility for SQL-language functions\n{% if model.config.get('language') == 'javascript' and model.config.get('volatility') %}\n  {# drop or warn: volatility is ignored for JS UDFs #}\n{% endif %}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep volatility config only on SQL UDFs.","Audit function configs when migrating between SQL and JavaScript.","Read the adapter's UDF support matrix before adding volatility."],"tags":["dbt","udf","javascript","warning"],"backgroundTag":"unsupported-config-value","analyzedSha":"0267ce9170576975b76b64ce856b2e5848e96617","analyzedAt":"2026-09-07T21:53:39.732Z","contentChangedAt":"2026-09-07T21:53:39.732Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}