-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SCD2 write disposition #828
Comments
Can currently navigate by running an incremental model in dbt as a workaround but its messy: e.g. (bq code)
|
@euanjohnston-dev what do you mean by
you can define sources in your dbt package, we just run it with |
@adrianbr per wiki article we are supporting the scd2 version flavor with our btw. scd4 looks way easier to implement (current state + history table). it could be just a flag in the loader module |
@rudolfix apologies I meant to write “snapshot” instead of “source”. It’s DBT’s way of handling SCD1 -> SCD2. |
Community Discussion here: https://dlthub-community.slack.com/archives/C05CJEDHG2F/p1706020707063669 |
As discussed, I'll pick up this issue from here. Most of what Dave has already suggested and implemented in #923 makes sense to me. I think these are the main cases seen in the wild: Source types:
Reference date types (values to use in validity columns):
Proposed scope: To keep the change small, I propose to only support source type (1) and reference date type (1) at first. We can extend later as per community interest. This would be supported:
Implementation details:
It seems this is mostly what's already in #923, so I'd use that as example and things should be fairly straightforward. |
Some notes about parent/child tables:
|
Feature description
Just as we have the "merge" write disposition, we should have a SCD2 write disposition
Are you a dlt user?
Yes, I'm already a dlt user.
Use case
Multiple users have requested slowly changing dimension support
Proposed solution
We should implement SCD2 as it's the most common, versatile and sufficient (users can add their own flags or modify it to other types via a view)
https://en.wikipedia.org/wiki/Slowly_changing_dimension#Type_2:_add_new_row
Implementation notes / ideas (by @sh-rp)
Related issues
No response
The text was updated successfully, but these errors were encountered: