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

Implement dbt snapshot #6

Closed
findinpath opened this issue Sep 20, 2021 · 12 comments · Fixed by #120
Closed

Implement dbt snapshot #6

findinpath opened this issue Sep 20, 2021 · 12 comments · Fixed by #120
Assignees
Labels
enhancement New feature or request

Comments

@findinpath
Copy link
Collaborator

findinpath commented Sep 20, 2021

See https://docs.getdbt.com/docs/building-a-dbt-project/snapshots

Possible reference to implement this feature:
https://github.com/dbt-labs/dbt/tree/develop/plugins/postgres

https://github.com/dbt-labs/dbt-spark/blob/master/dbt/include/spark/macros/materializations/snapshot.sql

@hovaesco hovaesco self-assigned this Sep 28, 2021
@hovaesco
Copy link
Member

hovaesco commented Nov 8, 2021

MERGE statement support in Trino engine is required for the implementation of Snapshot, related PR: trinodb/trino#7933

@hovaesco hovaesco added the enhancement New feature or request label May 9, 2022
@p11o
Copy link

p11o commented May 15, 2022

@hovaesco it may be a while until that PR gets merged. I noticed that other features that use the merge statement have been re-written here (i.e. incremental materialization). Would it be acceptable to take the same approach here?

@hovaesco
Copy link
Member

In order to have atomic merge incremental strategy, we do require MERGE statement support in Trino. My belief is that the only acceptable solution. Do you refer to other incremental strategies?

@p11o
Copy link

p11o commented May 16, 2022

Do you refer to other incremental strategies?

Hey thanks for taking the time to respond. Just so I'm on the same page, what do you mean by incremental strategies?

On my end I was referring to how dbt-trino overrides this merge statement for incremental models.

@mdesmet
Copy link
Member

mdesmet commented May 27, 2022

At this moment dbt_trino only supports append incremental models. See https://github.com/starburstdata/dbt-trino/blob/master/dbt/include/trino/macros/materializations/incremental.sql

We have an open PR for adding the delete+insert strategy. However to be able to test it, we need to expand the test setup with iceberg and delta.

I actually concur with @p11o that we could implement this feature using delete+insert but still would suggest getting above two PR's in first.

@retrry
Copy link

retrry commented Aug 27, 2022

Now that both merge and delete+insert is merged to main there are no blockers for this ticket?

@findinpath
Copy link
Collaborator Author

@retrry exactly, snapshot will likely land very soon on dbt-trino.

@retrry
Copy link

retrry commented Sep 14, 2022

Could you release dbt-trino 1.2.2 with snapshot support?

@hovaesco
Copy link
Member

Sure, we'll release it tomorrow, sorry for the delay.

@hovaesco
Copy link
Member

@retrry
Copy link

retrry commented Sep 15, 2022

@hovaesco thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants