dbt-labs / dbt-labs/dbt

[CT-3462] [Feature] Additional configurability of incremental merge strategy

Open
#9,223 1 comment 3 reactions 0 assignees View on GitHub
engine:v1 Refinement type:feature
Dominant language
Rust
Stars
13.8k
Forks
2.6k
Avg merge
21h 31m
Merged PRs (30d)
56

Description

### Is this your first time submitting a feature request?

- [X] I have read the [expectations for open source contributors](https://docs.getdbt.com/docs/contributing/oss-expectations)
- [X] I have searched the existing issues, and I could not find an existing issue for this feature
- [X] I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

### Describe the feature

In discussing #9060 with @jtcohen6 and @graciegoheen, we think there's opportunity to add some flexibility to the existing `merge` strategy by doing further generalization to one or more of the following sections of code:

- [merge statement in `get_merge_sql`](https://github.com/dbt-labs/dbt-core/blob/7eb6cdbbfbb239f1d9af24d256df228733a4c2df/core/dbt/include/global_project/macros/materializations/models/incremental/merge.sql#L35-L50)
- like proposed in [#9060 (comment)](https://github.com/dbt-labs/dbt-core/issues/9060#issuecomment-1813200957)
- [delete statements within `get_delete_insert_merge_sql`](https://github.com/dbt-labs/dbt-core/blob/7eb6cdbbfbb239f1d9af24d256df228733a4c2df/core/dbt/include/global_project/macros/materializations/models/incremental/merge.sql#L15-L31)
- [building the list of predicates within `get_merge_sql`](https://github.com/dbt-labs/dbt-core/blob/7eb6cdbbfbb239f1d9af24d256df228733a4c2df/core/dbt/include/global_project/macros/materializations/models/incremental/merge.sql#L63-L92)

Labeling this as "Refinement" to figure out which section(s) we want to add configurability to.

### Describe alternatives you've considered

_No response_

### Who will this benefit?

_No response_

### Are you interested in contributing this feature?

_No response_

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.