Skip to content

Commit

Permalink
make snapshot check strategy simpler and still correct
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbanin committed Aug 28, 2019
1 parent 1b03db6 commit 0970285
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,7 @@
)
{%- endset %}

{% if target_exists %}
{% set row_version -%}
(
select count(*) from {{ snapshotted_rel }}
where {{ snapshotted_rel }}.dbt_unique_key = {{ primary_key }}
)
{%- endset %}
{% set scd_id_cols = [primary_key, row_version] + (check_cols | list) %}
{% else %}
{% set scd_id_cols = [primary_key] + (check_cols | list) %}
{% endif %}

{% set scd_id_expr = snapshot_hash_arguments(scd_id_cols) %}
{% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}

{% do return({
"unique_key": primary_key,
Expand Down

0 comments on commit 0970285

Please sign in to comment.