This repository was archived by the owner on Sep 2, 2025. It is now read-only.
Create a new incremental_substrategy for insert_overwrite and microbatch - #1415
Open
borjavb wants to merge 13 commits into
Open
Create a new incremental_substrategy for insert_overwrite and microbatch#1415borjavb wants to merge 13 commits into
incremental_substrategy for insert_overwrite and microbatch#1415borjavb wants to merge 13 commits into
Conversation
borjavb
force-pushed
the
insert-overwrite-opt
branch
6 times, most recently
from
December 30, 2024 09:31
25e45c7 to
16be393
Compare
fixtures Create Features-20241229-174752.yaml
borjavb
force-pushed
the
insert-overwrite-opt
branch
2 times, most recently
from
December 30, 2024 12:31
6580895 to
d2e321a
Compare
incremental_substrategy for insert_overwrite and microbatch
borjavb
marked this pull request as ready for review
December 31, 2024 13:49
borjavb
force-pushed
the
insert-overwrite-opt
branch
from
January 17, 2025 19:36
d2e321a to
5893789
Compare
borjavb
force-pushed
the
insert-overwrite-opt
branch
from
January 24, 2025 10:54
06baa78 to
241119a
Compare
Contributor
|
This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves dbt-labs/dbt-adapters#527
docs dbt-labs/docs.getdbt.com/#
Problem
By default, we are using a
MERGEoperation when running aninsert_overwriteormicrobatchoperation. But this is not the most performant solution. In fact, we have different options with their pros and cons. Currently we only rely onmergethat is not the best performant solution and it doesn't allow fully parallelism formicrobatchoperations.Solution
In this PR we propose adding a new
incremental_substrategyformicrobatchandinsert_overwritethat will allow the user to select the best logic based on their needs.Additionally, based on experience the best combo I've seen is:
For that reason, we can add an additional
optimisedoption that will run the best operation available (and that can be updated in the future if needed){{ config( incremental_strategy={ "insert_overwrite", "microbatch" }, incremental_substrategy={ 'merge', -- by default if no substrategy is specified 'copy_partitions', -- same as defined in partitions_by 'delete+insert', 'optimised' -- if partitions is defined (static), used delete+insert, if not (dynamic), use copy partitions }, ... ) }}Note that the copy_partitions will also be backwards compatible by checking if it has been defined in the
partition_byconfig block.We could force every user to use the
optimisedby default with the new release, but I just feel unease given thatmergehas been the default for ever and people might have built logics assuming this behaviour...?Checklist