Generalized and extensible pattern for incremental_strategy #2366
Labels
enhancement
New feature or request
incremental
Incremental modeling with dbt
stale
Issues that have gone stale
Describe the feature
Based on the way we've implemented
incremental_strategy
in Snowflake, BigQuery, and Spark, users who wish to add their own incremental strategies need to override both:dbt_[adapter]_validate_get_incremental_strategy
macroget_merge_sql
,get_delete_insert_merge_sql
,get_insert_overwrite_sql
,get_insert_overwrite_merge_sql
).What would be really cool is a centralized macro that:
E.g. It could look something like:
Which I could then override locally to be:
I'm not sure how exactly we could handle the different keyword arguments needed by each. Possibly one of:
Describe alternatives you've considered
This works today! The introduction of
incremental_strategy
has empowered several analysts and data engineers who want to write custom DML to do so in a more dbtonic way. It just requires a lot more copy-paste than it should.Additional context
Relevant databases: Snowflake, BigQuery, Spark (so far)
Who will this benefit?
The text was updated successfully, but these errors were encountered: