Skip to content

Commit 9267964

Browse files
authored
fix hub key renaming if there are different namings for bk and hkey in the source_model and the staging-model and there is only one source model
1 parent 33d1a3c commit 9267964

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

macros/tables/bigquery/hub.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ WITH
147147
SELECT
148148
{{ hk_column }} AS {{ hashkey }},
149149
{% for bk in source_model['bk_columns'] -%}
150-
{{ bk }},
150+
{{ bk }} AS {{ business_keys[loop.index - 1] }},
151151
{% endfor -%}
152152

153153
{{ src_ldts }},
@@ -188,7 +188,7 @@ source_new_union AS (
188188
{{ hashkey }},
189189

190190
{% for bk in source_model['bk_columns'] -%}
191-
{{ bk }} AS {{ business_keys[loop.index - 1] }},
191+
{{ business_keys[loop.index - 1] }},
192192
{% endfor -%}
193193

194194
{{ src_ldts }},

macros/tables/exasol/hub.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ WITH
145145
SELECT
146146
{{ hk_column }} AS {{ hashkey }},
147147
{% for bk in source_model['bk_columns'] -%}
148-
{{ bk }},
148+
{{ bk }} AS {{ business_keys[loop.index - 1] }},
149149
{% endfor -%}
150150

151151
{{ src_ldts }},
@@ -186,7 +186,7 @@ source_new_union AS (
186186
{{ hashkey }},
187187

188188
{% for bk in source_model['bk_columns'] -%}
189-
{{ bk }} AS {{ business_keys[loop.index - 1] }},
189+
{{ business_keys[loop.index - 1] }},
190190
{% endfor -%}
191191

192192
{{ src_ldts }},

macros/tables/postgres/hub.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ WITH
147147
SELECT
148148
{{ hk_column }} AS {{ hashkey }},
149149
{% for bk in source_model['bk_columns'] -%}
150-
{{ bk }},
150+
{{ bk }} AS {{ business_keys[loop.index - 1] }},
151151
{% endfor -%}
152152

153153
{{ src_ldts }},
@@ -188,7 +188,7 @@ source_new_union AS (
188188
{{ hashkey }},
189189

190190
{% for bk in source_model['bk_columns'] -%}
191-
{{ bk }} AS {{ business_keys[loop.index - 1] }},
191+
{{ business_keys[loop.index - 1] }},
192192
{% endfor -%}
193193

194194
{{ src_ldts }},

macros/tables/redshift/hub.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ WITH
147147
SELECT
148148
{{ hk_column }} AS {{ hashkey }},
149149
{% for bk in source_model['bk_columns'] -%}
150-
{{ bk }},
150+
{{ bk }} AS {{ business_keys[loop.index - 1] }},
151151
{% endfor -%}
152152

153153
{{ src_ldts }},
@@ -188,7 +188,7 @@ source_new_union AS (
188188
{{ hashkey }},
189189

190190
{% for bk in source_model['bk_columns'] -%}
191-
{{ bk }} AS {{ business_keys[loop.index - 1] }},
191+
{{ business_keys[loop.index - 1] }},
192192
{% endfor -%}
193193

194194
{{ src_ldts }},

macros/tables/synapse/hub.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ WITH
147147
SELECT
148148
{{ hk_column }} AS {{ hashkey }},
149149
{% for bk in source_model['bk_columns'] -%}
150-
{{ bk }},
150+
{{ bk }} AS {{ business_keys[loop.index - 1] }},
151151
{% endfor -%}
152152

153153
{{ src_ldts }},
@@ -188,7 +188,7 @@ source_new_union AS (
188188
{{ hashkey }},
189189

190190
{% for bk in source_model['bk_columns'] -%}
191-
{{ bk }} AS {{ business_keys[loop.index - 1] }},
191+
{{ business_keys[loop.index - 1] }},
192192
{% endfor -%}
193193

194194
{{ src_ldts }},

0 commit comments

Comments
 (0)