quote_args
functions:
- name: <function name>
config:
snowflake:
quote_args: true | false # optional, default: true
Definition​
When creating JavaScript user-defined functions (UDFs) on Snowflake, quote_args controls whether argument names are quoted in the CREATE FUNCTION statement. Defaults to true.
When quote_args is true, Snowflake quotes argument names, which preserves their exact casing. Inside the function body, reference arguments using the same case as defined in the YAML (for example, a_string).
When quote_args is false, argument names are not quoted. Snowflake uppercases them automatically, so you must reference them in uppercase inside the function body (for example, A_STRING).
This config applies to JavaScript UDFs on Snowflake only. It has no effect on other adapters or languages.
Example​
In this example, quote_args is set to false so argument names are not quoted in the generated CREATE FUNCTION statement:
functions:
- name: is_positive_int
description: Returns 1 if a string represents a positive integer, else 0
config:
snowflake:
quote_args: false
arguments:
- name: a_string
data_type: string
returns:
data_type: integer
return /^[0-9]+$/.test(A_STRING) ? 1 : 0;
With quote_args: false, dbt generates:
CREATE OR REPLACE FUNCTION udf_db.udf_schema.is_positive_int(a_string STRING)
RETURNS INTEGER
LANGUAGE JAVASCRIPT
AS $$
return /^[0-9]+$/.test(A_STRING) ? 1 : 0;
$$;
With the default quote_args: true, dbt generates:
CREATE OR REPLACE FUNCTION udf_db.udf_schema.is_positive_int("a_string" STRING)
RETURNS INTEGER
LANGUAGE JAVASCRIPT
AS $$
return /^[0-9]+$/.test(a_string) ? 1 : 0;
$$;
Related documentation​
- User-defined functions
- Function properties
- Function configurations
- volatility
- type
- arguments
- returns
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.