-
Notifications
You must be signed in to change notification settings - Fork 175
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
Add upsert
merge strategy
#1129
Comments
See this draft PR for relevant discussions and code inspiration: #1294 |
My take, based on previous work in #1294: Add a new key-based merge strategy called
Source data can be both full or incremental extracts. Constraints:
Furthermore, as with
Implementation:
|
@jorritsandbrink my biggest question to the above: what you can do with it that you cannot do with the current merge? can you update from partial records? (on first look we'd need to add something on top to do that) I had something more modest in mind:
|
There's no extra functionality indeed. Clear semantics would be the main benefit. People are familiar with key-based "upsert", and know which behavior to expect.
An issue I see here: the merge strategy is called Also, what is the benefit? It would be challenging to elegantly mix both approaches. I think it makes more sense to give the user an option:
It's a leaky abstraction, but it enables the user to use the approach that is most performant for their workload. What do you think? |
@jorritsandbrink
|
Note that the
|
upsert
merge strategy
@jorritsandbrink ad 2. OK! could we implement that for Snowflake first and try to merge it before other destinations? if that's adding too much work. ad 3. Ok! I thing our initial merge strategy is the most powerful but I'll follow what you say. So we'll make |
|
@jorritsandbrink can we close it? |
Background
dlt
uses DELETE + INSERT to merge staging dataset into destination. It will also create temporary tables with _dlt_id of rows to be deleted and inserted. This may all not be necessary if MERGE sql is used. On supported database backend, MERGE looks even more standardized that various forms of DELETE that we had to hack.Tasks
The text was updated successfully, but these errors were encountered: