-
Notifications
You must be signed in to change notification settings - Fork 234
Open
Labels
triage:productIn Product's queueIn Product's queuetype:bugSomething isn't working as documentedSomething isn't working as documented
Description
Is this a new bug?
- I believe this is a new bug
- I have searched the existing issues, and I could not find an existing issue for this bug
Which packages are affected?
- dbt-adapters
- dbt-tests-adapter
- dbt-athena
- dbt-athena-community
- dbt-bigquery
- dbt-postgres
- dbt-redshift
- dbt-snowflake
- dbt-spark
Current Behavior
The dbt_scd_id is computed as
md5(
coalesce(cast(unique_key1 as string), '') || '|' ||
coalesce(cast(unique_key2 as string), '') || '|' ||
coalesce(cast(updated_at as string), '')
)
both in timestamp and check strategy.
Expected Behavior
When configured strategy is check according to the documentation it should be the hash of unique keys and columns provided in check_cols.
Steps To Reproduce
- Create a snapshot that tracks a source table.
- Add in snapshot configuration the unique_key, set strategy as 'check' and add in check_cols the columns you want to track for updates.
- Run the snapshot
- Select the snapshot dbt_scd_id and add in select a custom scd_id column as
md5(
coalesce(cast(unique_key1 as string), '') || '|' ||
coalesce(cast(unique_key2 as string), '') || '|' ||
coalesce(cast(check_col1 as string), '') || '|' ||
coalesce(cast(check_col2 as string), '')
)
which is how the dbt_scd_id is supposed to be computed in check strategy. - If you now select again and select a custom scd_id as
md5(
coalesce(cast(unique_key1 as string), '') || '|' ||
coalesce(cast(unique_key2 as string), '') || '|' ||
coalesce(cast(updated_at as string), '')
)
the dbt_scd_id matches with that one
Relevant log output
Environment
- OS: Ubuntu 22.04 (Databricks Runtime 15.4 LTS job cluster)
- Python: 3.11.11
- dbt-core: 1.10.13
- dbt-databricks: 1.9.1Additional Context
No response
Metadata
Metadata
Assignees
Labels
triage:productIn Product's queueIn Product's queuetype:bugSomething isn't working as documentedSomething isn't working as documented