반응형 Macro1 [dbt] dbt에서 for loop 작성하기(jinja macro) | LIM dbt for loop 작성하는 것은 파이썬의 for loop 을 작성하는 것과 매우 유사하다. 나의 경우 union all 을 할 때 for loop 을 사용했다. 💡 테스트할 테이블 스키마 date_column: date month: int64 [for loop 을 사용하지 않은 쿼리] select date('2023-01-01') as date_column, 1 as month union all select date('2023-02-01') as date_column, 2 as month union all select date('2023-03-01') as date_column, 3 as month [dbt 를 활용해서 for loop 을 사용] {{ config( materialized="tabl.. 2023. 11. 28. 이전 1 다음 반응형