Skip to content
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

create a snapshot on sources that already have some history #10320

Open
Tracked by #10151
graciegoheen opened this issue Jun 17, 2024 · 1 comment
Open
Tracked by #10151

create a snapshot on sources that already have some history #10320

graciegoheen opened this issue Jun 17, 2024 · 1 comment
Labels
snapshots Issues related to dbt's snapshot functionality

Comments

@graciegoheen
Copy link
Contributor

Jumping into the discussion to add one suggestion/idea. Sorry if this was already discussed, I couldn't find it.

One complaint I hear from time to time is that you can't create a snapshot if the source has duplicates.

Imagine we have a source like

id status date
1 created 2024-01-01
1 processed 2024-02-01

It would be nice if the snapshot, in its first run, could read this source and be built like

id status date dbt_valid_from dbt_valid_to
1 created 2024-01-01 2024-01-01 2024-02-01
1 processed 2024-02-01 2024-02-01 null

We could have something similar to incremental models

  • If the snapshot does not exist in the platform (first run), create a history of the source's data, instead of trying to insert only
  • if the snapshot exists in the platform, then go the default way

It would only work for the timestamp strategy, because the snapshot must know what is older and what is newer.

Just an idea, maybe there are other ways to do it. But just because it is bad when we can't create a snapshot on sources that already have some history.

By the way, loved that snapshots are in the spotlight! 🧡

Originally posted by @bruno-szdl in #7018 (comment)

@graciegoheen graciegoheen added the snapshots Issues related to dbt's snapshot functionality label Jun 17, 2024
@graciegoheen
Copy link
Contributor Author

More thinking here -> #3878

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
snapshots Issues related to dbt's snapshot functionality
Projects
None yet
Development

No branches or pull requests

1 participant