dbt-databricks icon indicating copy to clipboard operation
dbt-databricks copied to clipboard

Support for custom incremental strategies

Open mcowart123 opened this issue 6 months ago • 3 comments

Describe the feature

Adding support for Custom Incremental Strategies.

Who will this benefit?

This will allow users to easily modify the MERGE command to take into account additional data from the table_changes function (for example)

merge into {{ target }} as DBT_INTERNAL_DEST
      using {{ source }} as DBT_INTERNAL_SOURCE
      on {{ predicates | join(' and ') }}
      when matched and DBT_INTERNAL_SOURCE._change_type = 'update_postimage' then update set {{ get_merge_update_set(update_columns, on_schema_change, source_columns) }}
      when not matched and DBT_INTERNAL_SOURCE._change_type != 'delete' then insert {{ get_merge_insert(on_schema_change, source_columns) }}
      when matched and DBT_INTERNAL_SOURCE._change_type = 'delete' then delete

mcowart123 avatar Jul 31 '24 19:07 mcowart123