I am trying to use the column_override
arg in the dbt_utils union_relations
macro,
but it doesn’t seem to work when my code compiles.
{{ dbt_utils.union_relations(
relations=[
ref('base_consumer_digital_ad_performance_apple_ads_spend'),
ref('base_consumer_digital_ad_performance_facebook_spend'),
ref('base_consumer_digital_ad_performance_tiktok_spend'),
ref('base_consumer_digital_ad_performance_google_spend')
],
column_override={"digital_campaign_id":"TEXT"}
) }}
(
select
cast('DBT_CCARREL.staging.base_consumer_digital_ad_performance_apple_ads_spend' as TEXT) as _dbt_source_relation,
cast("AD_DATE" as DATE) as "AD_DATE" ,
cast("ACQUISITION_PARTNER" as character varying(9)) as "ACQUISITION_PARTNER" ,
cast("DIGITAL_CAMPAIGN_ID" as NUMBER(38,0)) as "DIGITAL_CAMPAIGN_ID" ,
cast("DIGITAL_ADSET_ID" as NUMBER(38,0)) as "DIGITAL_ADSET_ID" ,
cast("DIGITAL_AD_ID" as NUMBER(38,0)) as "DIGITAL_AD_ID" ,
cast("IMPRESSIONS" as NUMBER(38,0)) as "IMPRESSIONS" ,
cast("CLICKS" as NUMBER(38,0)) as "CLICKS" ,
cast("SPEND" as NUMBER(18,4)) as "SPEND" ,
cast("AD_PERFORMANCE_UUID" as character varying(32)) as "AD_PERFORMANCE_UUID"
from DBT_CCARREL.staging.base_consumer_digital_ad_performance_apple_ads_spend
)
union all
any help to understand what I am doing wrong would be awesome