cdi attribute 를 현재 dbt 로 어떻게 활용하고 있는지, 어떻게 개선해나갈지 공유한다.

Current Status

model mangement

# tree
braze/
├── cdi.md
├── cdi_attribute.sql
├── cdi_attribute.yml
...
└── event_win
    ├── README.md
    ├── cdi_attribute__event_win__krw_transfer.sql
    ├── cdi_attribute__event_win_coin.sql
    ├── cdi_attribute__event_win_coin.yml
    ├── cdi_attribute__event_win_common.sql
    ├── cdi_attribute__event_win_pnl.sql
    ├── cdi_attribute__event_win_pnl.yml
    ├── cdi_attribute__event_win_required.sql
    ├── cdi_attribute__event_win_required.yml
    ├── cdi_attribute__event_win_winner.sql
    └── cdi_attribute__event_win_winner.yml

cdi_attributes management

결론

flowchart TB
    A[현 상황 파악]
    A1{이벤트 자주 할꺼야?}
    A2{자동화 할꺼야?}
    A3{자유롭게 만들 수 있도록 할꺼야?}
    B[현행유지 & 조금만 다듬기]
    D[분석가도 쉽게 만들 수 있도록 패키징]

    A --> A1
    A1 --> |Yes| A2
    A1 --> |No| B
    A2 --> |No| B
    A2 --> |Yes| A3
    A3 --> |No| B
    A3 --> |Yes| D

Alternatives

현행 유지 (덧대기)

pros

cons

Building dbt packages

pros

select *
from {{ cdi_attribute.generate(
    base_query={}
    attribute_name={},
    arg2={value2},
    ...
) }}

cons

In My Opinion

todo