Skip to content

Commit

Permalink
tidy up snowflake__get_incremental_microbatch_sql
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Sep 14, 2024
1 parent c47eff4 commit d4a2b66
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dbt/include/snowflake/macros/materializations/merge.sql
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
{% macro snowflake__get_incremental_microbatch_sql(arg_dict) %}
{% set incremental_predicates = [] if arg_dict.get('incremental_predicates') is none else arg_dict.get('incremental_predicates') %}
{#-- Add additional incremental_predicates if it is safe to do so --#}
{% if model.config.event_time -%}
{% if model.config.event_time_start -%}
{% do incremental_predicates.append("DBT_INTERNAL_DEST" ~ "." ~ model.config.event_time ~ " >= " ~ model.__dbt_internal_microbatch_event_time_start) %}
{% if config.get("event_time") -%}
{% if config.get("__dbt_internal_microbatch_event_time_start") -%}
{% do incremental_predicates.append("DBT_INTERNAL_DEST" ~ "." ~ config.event_time ~ " >= " ~ config.__dbt_internal_microbatch_event_time_start) %}
{% endif %}
{% if model.config.event_time_start -%}
{% do incremental_predicates.append("DBT_INTERNAL_DEST" ~ "." ~ model.config.event_time ~ " < " ~ model.__dbt_internal_microbatch_event_time_start) %}
{% if model.config.__dbt_internal_microbatch_event_time_end -%}
{% do incremental_predicates.append("DBT_INTERNAL_DEST" ~ "." ~ model.config.event_time ~ " < " ~ model.__dbt_internal_microbatch_event_time_end %}
{% endif %}
{% endif %}
{% do arg_dict.update({'incremental_predicates': incremental_predicates}) %}
Expand Down

0 comments on commit d4a2b66

Please sign in to comment.