diff --git a/dbt/include/global_project/macros/materializations/models/incremental/merge.sql b/dbt/include/global_project/macros/materializations/models/incremental/merge.sql index 2f9c2dee..c5920716 100644 --- a/dbt/include/global_project/macros/materializations/models/incremental/merge.sql +++ b/dbt/include/global_project/macros/materializations/models/incremental/merge.sql @@ -22,7 +22,7 @@ {% endfor %} {% else %} {% set unique_key_match %} - {{ adapter.dispatch('equals', 'dbt')(DBT_INTERNAL_SOURCE.{{ unique_key }}, DBT_INTERNAL_DEST.{{ unique_key }}) }} + {{ equals(DBT_INTERNAL_SOURCE.{{ unique_key }}, DBT_INTERNAL_DEST.{{ unique_key }}) }} {% endset %} {% do predicates.append(unique_key_match) %} {% endif %} @@ -66,7 +66,7 @@ using {{ source }} where ( {% for key in unique_key %} - {{ adapter.dispatch('equals', 'dbt')({{ source }}.{{ key }}, {{ target }}.{{ key }}) }} + {{ equals({{ source }}.{{ key }}, {{ target }}.{{ key }}) }} {{ "and " if not loop.last}} {% endfor %} {% if incremental_predicates %} diff --git a/dbt/include/global_project/macros/materializations/snapshots/helpers.sql b/dbt/include/global_project/macros/materializations/snapshots/helpers.sql index f72e71e0..ff42fea4 100644 --- a/dbt/include/global_project/macros/materializations/snapshots/helpers.sql +++ b/dbt/include/global_project/macros/materializations/snapshots/helpers.sql @@ -53,7 +53,7 @@ from {{ target_relation }} where {% if config.get('dbt_valid_to_current') %} - {{ adapter.dispatch('equals', 'dbt')({{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }} + {{ equals({{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }} {% else %} {{ columns.dbt_valid_to }} is null {% endif %} @@ -275,7 +275,7 @@ {% macro unique_key_join_on(unique_key, identifier, from_identifier) %} {% if unique_key | is_list %} {% for key in unique_key %} - {{ adapter.dispatch('equals', 'dbt')({{ identifier }}.dbt_unique_key_{{ loop.index }}, {{ from_identifier }}.dbt_unique_key_{{ loop.index }}) }} + {{ equals({{ identifier }}.dbt_unique_key_{{ loop.index }}, {{ from_identifier }}.dbt_unique_key_{{ loop.index }}) }} {%- if not loop.last %} and {%- endif %} {% endfor %} {% else %} diff --git a/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql b/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql index 2d10d153..cd2cdebd 100644 --- a/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql +++ b/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql @@ -15,7 +15,7 @@ when matched {% if config.get("dbt_valid_to_current") %} - and {{ adapter.dispatch('equals', 'dbt')(DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }} + and {{ equals(DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }} {% else %} and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null diff --git a/dbt/include/global_project/macros/utils/equals.sql b/dbt/include/global_project/macros/utils/equals.sql index 2920b7b0..d63b6cc1 100644 --- a/dbt/include/global_project/macros/utils/equals.sql +++ b/dbt/include/global_project/macros/utils/equals.sql @@ -1,4 +1,4 @@ -{% macro equals(first_date, second_date, datepart) %} +{% macro equals(expr1, expr2) %} {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }} {%- endmacro %}