Skip to content

Commit dd07142

Browse files
committed
Remove ghost record changes from this branch
1 parent e5e2acf commit dd07142

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

macros/supporting/ghost_records/create_ghost_record.sql

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{%- macro default__create_ghost_record(src_pk, src_hashdiff, src_payload, src_extra_columns, src_eff, src_ldts, src_source, source_model) -%}
1616

1717
{%- set hash = var('hash', 'MD5') -%}
18-
{%- set system_record_value = var('system_record_value', 'AUTOMATE_DV_SYSTEM') -%}
18+
{%- set source_str = var('system_record_value', 'AUTOMATE_DV_SYSTEM') -%}
1919
{%- set columns = adapter.get_columns_in_relation(ref(source_model)) -%}
2020
{%- set col_definitions = [] -%}
2121

@@ -44,29 +44,9 @@
4444
{%- do col_definitions.append(col_sql) -%}
4545

4646
{%- elif (col_name | lower) == (src_source | lower) -%}
47-
48-
{%- if target.type != 'databricks' -%}
49-
{% if col.is_string() %}
50-
{%- set col_type -%}
51-
{{ col.dtype }}{% if target.type != 'bigquery' %}({{ col.string_size() }}){% endif %}
52-
{%- endset -%}
53-
{% else %}
54-
{%- set col_type -%}
55-
VARCHAR
56-
{%- endset -%}
57-
{%- endif -%}
58-
{%- else -%}
59-
{%- if col.is_string() -%}
60-
{%- set col_type = '{}({})'.format('VARCHAR', col.string_size()) -%}
61-
{%- else -%}
62-
{%- set col_type = col.dtype -%}
63-
{%- endif -%}
64-
{%- endif -%}
65-
6647
{%- set col_sql -%}
67-
CAST('{{ system_record_value }}' AS {{ col_type }}) AS {{ src_source }}
48+
CAST('{{ source_str }}' AS {{ col.dtype }}) AS {{ src_source }}
6849
{%- endset -%}
69-
7050
{%- do col_definitions.append(col_sql) -%}
7151

7252
{%- elif (col_name | lower) is in (string_columns | map('lower') | list) -%}

0 commit comments

Comments
 (0)