dbt-databricks
dbt-databricks copied to clipboard
Support for custom incremental strategies
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