From 87871676707e771461bc4a6e7db892d90d53ea7a Mon Sep 17 00:00:00 2001 From: mikaelene Date: Mon, 11 Jan 2021 08:30:15 +0100 Subject: [PATCH] Changed snapshot logic to apply with dbt core. Possibly fixing an unidentified bug :-) --- .../macros/materializations/snapshot/strategies.sql | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dbt/include/sqlserver/macros/materializations/snapshot/strategies.sql b/dbt/include/sqlserver/macros/materializations/snapshot/strategies.sql index fc9c138c..812f63fc 100644 --- a/dbt/include/sqlserver/macros/materializations/snapshot/strategies.sql +++ b/dbt/include/sqlserver/macros/materializations/snapshot/strategies.sql @@ -22,7 +22,11 @@ {% for col in check_cols %} {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }} or - ({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null) + ( + (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null)) + or + ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null)) + ) {%- if not loop.last %} or {% endif %} {% endfor %}