From 3f69144b88276b94d955d046c355de797cc30f12 Mon Sep 17 00:00:00 2001 From: Theo Kiehn <162969167+tkiehn@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:28:59 +0200 Subject: [PATCH] fix redshift/postgres beginning_of_all_times ghost record values beginning_of_all_times_date was used instead of beginning_of_all_times, therefore if the defaults were not changed the ghost record value of the unknown records had 00:00:00 instead of 00:00:01 as time. --- macros/supporting/ghost_record_per_datatype.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros/supporting/ghost_record_per_datatype.sql b/macros/supporting/ghost_record_per_datatype.sql index c51adbe9..be898ebc 100644 --- a/macros/supporting/ghost_record_per_datatype.sql +++ b/macros/supporting/ghost_record_per_datatype.sql @@ -341,7 +341,7 @@ {%- set datatype = datatype | string | upper | trim -%} {%- if ghost_record_type == 'unknown' -%} - {%- if 'TIMESTAMP' in datatype %}{{ datavault4dbt.string_to_timestamp(timestamp_format, beginning_of_all_times_date) }} AS {{ alias }} + {%- if 'TIMESTAMP' in datatype %}{{ datavault4dbt.string_to_timestamp(timestamp_format, beginning_of_all_times) }} AS {{ alias }} {%- elif datatype == 'TIME WITH TIME ZONE' %} CAST('00:00:01 UTC' as TIMETZ) as {{ alias }} {%- elif datatype == 'TIME WITHOUT TIME ZONE' %} CAST('00:00:01' as TIME) as {{ alias }} {%- elif datatype == 'DATE'-%} TO_DATE('{{ beginning_of_all_times_date }}', '{{ date_format }}' ) as {{ alias }} @@ -395,7 +395,7 @@ {%- set datatype = datatype | string | upper | trim -%} {%- if ghost_record_type == 'unknown' -%} - {%- if 'TIMESTAMP' in datatype %}{{ datavault4dbt.string_to_timestamp(timestamp_format, beginning_of_all_times_date) }} AS {{ alias }} + {%- if 'TIMESTAMP' in datatype %}{{ datavault4dbt.string_to_timestamp(timestamp_format, beginning_of_all_times) }} AS {{ alias }} {%- elif datatype == 'TIMETZ' %} CAST('00:00:01 UTC' as TIMETZ) as {{ alias }} {%- elif datatype == 'TIME' %} CAST('00:00:01' as TIME) as {{ alias }} {%- elif datatype == 'DATE'-%} TO_DATE('{{ beginning_of_all_times_date }}', '{{ date_format }}' ) as {{ alias }}