I'm trying to implement a "merge_exclude_columns" configuration in my dbt project as suggested here:
https://github.com/dbt-labs/dbt-core/pull/3100#issuecomment-904502858
My question is kind of basic - I assume I need to add this macro to the exsiting merge.sql macro but now sure where I'm suppose to find it.
Thank you.
If it helps, the global dbt macros are located in the following path in the dbt-core repository. If you are specifically looking for the merge.sql
implementation, it can be found here.
You can override global dbt macros by creating a macro in your local project using the same name, therefore allowing re-implementation of the global macro. If you are wanting to implement additional logic in merge.sql
I would suggest overriding it, include all existing code plus add anything additional to achieve your merge_exclude_columns
configuration.
An example where this is often done is the generate_schema_name
macro, which handles how schema name concatenation behaves between project level and model level schema settings. By creating a macro named generate_schema_name
in my own project I can override the global macro and define how I want schema concatenation to work in my own project.