Skip to content

Commit

Permalink
Update escape_column_names.sql, add redshift__escape_column_names
Browse files Browse the repository at this point in the history
Redshift used the postgres-specific macro which lead to not escaping the column names
  • Loading branch information
tkiehn authored Aug 19, 2024
1 parent af52479 commit 312d832
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion macros/internal/metadata_processing/escape_column_names.sql
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@

{%- endmacro -%}

{%- macro redshift__escape_column_name(column) -%}

{%- set escape_char_left = var('escape_char_left', '"') -%}
{%- set escape_char_right = var('escape_char_right', '"') -%}

{%- set escaped_column_name = escape_char_left ~ column | lower | replace(escape_char_left, '') | replace(escape_char_right, '') | trim ~ escape_char_right | indent(4) -%}

{%- do return(escaped_column_name) -%}

{%- endmacro -%}

{%- macro exasol__escape_column_name(column) -%}

{%- set escape_char_left = var('escape_char_left', '') -%}
Expand All @@ -154,4 +165,4 @@

{%- do return(escaped_column_name) -%}

{%- endmacro -%}
{%- endmacro -%}

0 comments on commit 312d832

Please sign in to comment.