From 5a8e1f13543918aafcd408f47e32414e2ff60567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A1udio=20Filipe=20Paiva=20Diniz?= Date: Wed, 17 Apr 2024 21:28:55 +0100 Subject: [PATCH] Add databricks quote identifier adapter --- macros/utils.sql | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/macros/utils.sql b/macros/utils.sql index 082da6e..c1f15a9 100644 --- a/macros/utils.sql +++ b/macros/utils.sql @@ -191,7 +191,7 @@ {% endif %} {%- endmacro %} -{% macro spark__quote_identifier(identifier) %} +{% macro bigquery__quote_identifier(identifier) %} {% if identifier.startswith('`') %} {{ return(identifier) }} {% else %} @@ -199,14 +199,14 @@ {% endif %} {% endmacro %} -{% macro bigquery__quote_identifier(identifier) %} +{% macro databricks__quote_identifier(identifier) %} {% if identifier.startswith('`') %} {{ return(identifier) }} {% else %} {{ return('`' ~ identifier ~ '`') }} {% endif %} {% endmacro %} - + {% macro snowflake__quote_identifier(identifier) %} {% if identifier.startswith('"') %} {{ return(identifier) }} @@ -215,6 +215,14 @@ {% endif %} {% endmacro %} +{% macro spark__quote_identifier(identifier) %} + {% if identifier.startswith('`') %} + {{ return(identifier) }} + {% else %} + {{ return('`' ~ identifier ~ '`') }} + {% endif %} +{% endmacro %} + {% macro cache(scope_key, key, value) %} {% if dbt_unit_testing.config_is_true('disable_cache') %} {{ return (nil) }}