invocation_id 컨텍스트 변수

invocation_id 컨텍스트 변수

invocation_id는 이 dbt 명령어를 위해 생성된 UUID를 출력해요. 이 값은 dbt 실행(invocation) 메타데이터를 감사하거나 분석할 때 유용해요.

출처: 문서

본문

가능할 때 invocation_id는 다음과 같이 쓰여요:

  • query-comment의 컴파일 컨텍스트에서 사용 가능해요
  • dbt events and logsinfo 사전에 포함돼요
  • dbt artifactsmetadata 사전에 포함돼요
  • dbt가 발생시키는 모든 BigQuery job의 라벨로 포함돼요

사용 예시: 아래 예제 코드를 모든 데이터 플랫폼에서 사용할 수 있어요. TABLE_NAME은 대상 테이블의 실제 이름으로 바꿔야 해요:

select '{{ invocation_id }}' as test_id from TABLE_NAME

더 알아보기 (Learn more)

  • invocation_id는 dbt 실행 단위마다 달라져서 감사/추적용으로 쓰기 좋아요.
  • 관련 개념: query-comment, dbt artifacts, events and logs.