Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- dbt_project
- mysql
- 카프카
- 윈도우
- query history
- bar cahrt
- CDC
- 모바일
- numpartitions
- 파이썬
- ksql
- 크롤링
- polars
- KubernetesPodOperator
- spring boot
- proerty
- Materializations
- 동적 차트
- DBT
- spark
- airflow
- kafka
- 쿠버네티스
- 도커
- Java
- k9s
- docker
- freshness
- Python
- UI for kafka
Archives
- Today
- Total
데이터 엔지니어 이것저것
dbt packages 본문
728x90
dbt에서는 라이브러리를 패키지 라고 한다
dbt 패키지 추가하는법
dbt_project.yml 파일과 같은 레벨의 dir에 packages.yml 파일을 추가한다.
packages:
- package: dbt-labs/dbt_utils
version: 1.1.1
그리고 원하는 패키지와, 버전을 작성하면 된다.
하지만 바로 실행을 하면 에러가 발생하는데
dbt deps
해당 명령어를 통해 설치
관련 사용가능한 함수 : https://github.com/dbt-labs/dbt-utils
GitHub - dbt-labs/dbt-utils: Utility functions for dbt projects.
Utility functions for dbt projects. Contribute to dbt-labs/dbt-utils development by creating an account on GitHub.
github.com
- name: orders
columns:
- name: country_code
tests:
- dbt_utils.not_constant
이러한 형태로 tests 에 추가를 하고 테스트 코드를 돌리면
select
count(distinct country_code) as filler_column
from "root"."source"."orders"
having count(distinct country_code) = 1
이렇게 쿼리를 작성해서 테스트를 한다.
728x90
'오픈소스 > dbt' 카테고리의 다른 글
dbt codegen (0) | 2023.11.20 |
---|---|
dbt docs (0) | 2023.11.19 |
dbt Materializations (0) | 2023.11.17 |
dbt macros (0) | 2023.11.15 |
dbt_project.yml (0) | 2023.11.15 |