The problem I’m having ------------------------------------------------------------------------------------------
I had a snapshot that worked, using the check strategy to pick up if anyone changes their email address with us. Code:
{% snapshot dev_dsb__customer_email_change_snapshot_final %}
{{
config(
target_schema="snapshots",
strategy="check",
unique_key="hash_id",
check_cols=["person_reference_urn", "email_address"],
)
}}
select
convert(varchar(32), hashbytes('MD5', person_reference_urn), 2) as hash_id,
*
from
(
select
row_number() over (
partition by person_reference_urn
order by concat(email_address, phone_number) desc
) as rowss,
*
from {{ source("dev_dsb", "customer") }}
) as a
where rowss = 1
{% endsnapshot %}
What I’ve already tried --------------------------------------------------------------------------
To be honest we haven’t tried much, we just came in today and the snapshot had no dates in the dbt_valid_to column, where there used to be about a 1000. We have re-run and checked adn the same issue persists.
Full question --------------------------------------------------------------------------
I am more than happy to accept this is something we did, however is there a scenario where the snapshot will be restarted when run or built?
Help is appreciated.