Skip to content

Commit

Permalink
lower functions for casing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-joemarkiewicz committed Sep 27, 2023
1 parent 29d4d28 commit a03b219
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions macros/remove_duplicate_and_prefix_from_columns.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

{%- set duplicate_exclude = [] -%}
{% for col in columns if col.name not in exclude %}
{%- for dupe in columns if col.name[prefix|length:]|lower == dupe.name -%}
{%- for dupe in columns if col.name[prefix|length:]|lower == dupe.name|lower -%}
{%- do duplicate_exclude.append(col.name) -%}
{%- do duplicate_exclude.append(dupe.name) -%}
, coalesce({{ col.name }}, {{dupe.name}}) as {{ col.name[prefix|length:] }}
{%- endfor %}
{%- if col.name not in duplicate_exclude -%}
{%- if col.name|lower not in duplicate_exclude|lower -%}
{% if col.name[:prefix|length]|lower == prefix %}
, {{ col.name }} as {{ col.name[prefix|length:] }}
{%- else %}
Expand Down

0 comments on commit a03b219

Please sign in to comment.