Datavault-UK / automate-dv

A free to use dbt package for creating and loading Data Vault 2.0 compliant Data Warehouses (powered by dbt, an open source data engineering tool, registered trademark of dbt Labs)
https://www.automate-dv.com
Apache License 2.0
478 stars 114 forks source link

[FEATURE] - Add string constant support for XTS macro #192

Open RonniePitts opened 1 year ago

RonniePitts commented 1 year ago

In the XTS macro we need to specify the SATELLITE name as an additional column which typically exists in the staging macro as the below example shows :

image

These additional devised columns can be painful when multiple satellite are sourced from the staging model.

My feature is to support a string constant as we do in the staging macro which would allows us to reference a macro to return the node name.

For example: src_satellite: SAT_CUSTOMER_DETAILS: sat_name: SATELLITE_NAME: '!{{get_satobject(this}}}' hashdiff: HASHDIFF: CUSTOMER_HASHDIFF

get_satobject receives the SAT_CUSTOMER_DETAILS node and returns the node name of which is SAT_CUSTOMER_DETAILS given this is typically what the string constant name is in the staging model derived fields anyhow.

AB#5362