DBT
Example - dbt_project.yml
# Name your project! Project names should contain only lowercase characters and underscores. A good package name should reflect your organization's name or the intended use of these models
name: 'onedb_modern_analytics'
version: '1.0.0'
config-version: 2
# This setting configures...
Example - Analytics_Schedule.yml
name: ANALYTICS_WORKFLOW
# Controls when the action will run.
on:
# Triggers the workflow every day at 16:45 UTC
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '45 16 * *...
Example - API_Trigger.yml
#========================================================================================================================
# -- Create date: 23-Aug-2021
# -- Description: This workflow is used to trigger DBT jobs via a rest...
Example - Nightly_DBT_Test_Schedule.yml
#========================================================================================================================
# -- Description: This workflow is used to perform various operations such as
# 1- Clone prod...
Example - Test_DBT_Execute.yml
#========================================================================================================================
# -- Description: This workflow is used to perform various operations such as
# 1- Clone the...
Example - Prod_DBT_Schedule.yml
name: DBT_prod_scheduled_workflow
# Controls when the action will run.
on:
# Triggers the workflow every day at 23:00 UTC
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 23...
Example - Prod_DBT_Deploy.yml
name: DBT_prod_deploy_workflow
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
# Environment variable values are retrived from Github...
Example - Prod_DBT_Schedule_self-host.yml
name: DBT_prod_scheduled_workflow
# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
name:
...
Macro - Convert date to YYYYMMDD key format
{% macro generate_surrogate_wid_date_key(column_name) %} Concat( year({{ column_name }}), Right( Concat(0, month({{ column_name }}) ),2 ), Right( Concat(0, day({{ column_name }}) ),2 ) ) {% endmacro %}
Incremental
{{
config(
materialized = 'incremental',
unique_key = 'ROW_WID',
comment='Warehouse Layer WC_CAR_PRODUCT_D',
...