Skip to content

Commit

Permalink
Merge pull request #205 from bjgbeelen/add-spark-identifier
Browse files Browse the repository at this point in the history
Update star macro to use adapter.quote
  • Loading branch information
drewbanin authored Apr 23, 2020
2 parents 99d44a3 + c95ed6b commit 7abce81
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 0 additions & 12 deletions macros/cross_db_utils/identifer.sql

This file was deleted.

12 changes: 12 additions & 0 deletions macros/cross_db_utils/identifier.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% macro identifier(value) %}
{% do exceptions.warn("Warning: the `identifier` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use `adapter.quote` instead") %}
{{ adapter_macro('dbt_utils.identifier', value) }}
{% endmacro %}

{% macro default__identifier(value) -%}
"{{ value }}"
{%- endmacro %}

{% macro bigquery__identifier(value) -%}
`{{ value }}`
{%- endmacro %}
2 changes: 1 addition & 1 deletion macros/sql/star.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

{%- for col in include_cols %}

{%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ dbt_utils.identifier(col)|trim }}
{%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}{{ adapter.quote(col)|trim }}
{%- if not loop.last %},{{ '\n ' }}{% endif %}

{%- endfor -%}
Expand Down

0 comments on commit 7abce81

Please sign in to comment.