DBT

Ephemeral

{{     config(             materialized = 'ephemeral'     ) }} select * from {{ source('oracleoacs_onedb', 'WC_CAR_D')}} where type_cd = 'Car Account'  

Transient - Historical

{{       config(         materialized='table',         transient=true,         schema='edw_transient',         unique_key = 'ROW_WID',        ...

Table Model - YML

{{       config(         materialized = 'table',          unique_key = 'ROW_WID',            comment='Warehouse Layer WC_CAR_CLIENT_H',         tags =...

Dual warehouse testing

  Here is an example I used for product. You will need to change the existing_table config and add any columns you don’t want to check in the exceptions section (because they are new or we don’t expect it to match the old warehouse). The join_keys parameter allows us to specify what we use...

Load the seed to schema

Load the seed to schema (than delete the seed) dbt seed --select NON_FLEX_PERSON_DATA

Fixing long paths errors

If you get an error about long paths then you will need to update you registry key for long paths Open registry editor find the key and set the value to 1 Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled dbt_project.yml - Not found Add to Windows...

Rebuild an incremental model with full refresh

dbt deps dbt build --select WC_REVN_D --full-refresh

SSH To setup - DBT on Snowflake

DBT Cloud Set Up SSH Key Generate a new Key for DBT in a terminal (You can do this in the DBT container if you don’t have OpenSSL installed locally). This will require you to set a password in the first command and then repeat it for the second command. openssl genrsa...

zero_flag

/* if <value> is NULL:     return 0 else:     return <value> */ {% macro zero_flag(column_name) %}     case when {{ column_name }} is null then 0 else {{ column_name }} end {% endmacro %}  

update_person_delete_flg

/* This macro is to used as a post hook for WC_PERSON_D The purpose is to update the DELETED flag in dw table is the source records has been updated to deleted. To check whether a source table exist, see...

<< 1 | 2 | 3 | 4 >>