config 속성

config 속성 (About config property)

config 속성은 YAML 파일에서 속성(property)을 정의하는 동시에 리소스를 설정하게 해줘요. 리소스 타입별로 config 블록 안에 해당 config를 넣을 수 있어요.

출처: 문서

본문

models/.yml

models:
  - name: <model_name>
    config:
      <model_config>: <config_value>
      ...

seeds/.yml

seeds:
  - name: <seed_name>
    config:
      <seed_config>: <config_value>
      ...

snapshots/.yml

snapshots:
  - name: <snapshot_name>
    config:
      <snapshot_config>: <config_value>
      ...

/.yml

<resource_type>:
  - name: <resource_name>
    data_tests:
      - <test_name>:
          arguments: # available in v1.10.5 and higher. Older versions can set the <argument_name> as the top-level property.
            <argument_name>: <argument_value>
          config:
            <test_config>: <config-value>
            ...

    columns:
      - name: <column_name>
        data_tests:
          - <test_name>
          - <test_name>:
              arguments: # available in v1.10.5 and higher. Older versions can set the <argument_name> as the top-level property.
                <argument_name>: <argument_value>
              config:
                <test_config>: <config-value>
                ...

알아두세요: dbt v1.8부터 또는 dbt "v1 Latest" 릴리스 트랙에서 사용할 수 있어요.

(dbt v2.0 이상 적용) models/.yml

unit_tests:
  - name: <test-name>
    config:
      compute: local | remote
      enabled: true | false
      meta: {dictionary}
      static_analysis: strict | baseline | off
      tags: <string>

models/.yml

sources:
  - name: <source_name>
    config:
      <source_config>: <config_value>
    tables:
      - name: <table_name>
        config:
          <source_config>: <config_value>

models/.yml

metrics:
  - name: <metric_name>
    config:
      enabled: true | false
      group: <string>
      meta: {dictionary}

models/.yml

exposures:
  - name: <exposure_name>
    config:
      enabled: true | false
      meta: {dictionary}

(dbt v1.12 이상 적용) models/.yml

models:
  - name: model_name
    semantic_model:
      enabled: true | false
      group: <string>
      config:
        meta: {dictionary}

models/.yml

saved-queries:
  - name: <saved_query_name>
    config:
      cache:
        enabled: true | false
      enabled: true | false
      group: <string>
      meta: {dictionary}
      schema: <string>
    exports:
      - name: <export_name>
        config:
          export_as: view | table
          alias: <string>
          schema: <string>

Definition

config 속성은 YAML 파일에서 속성을 정의하는 동시에 리소스를 설정할 수 있게 해줘요.

더 알아보기 (Learn more)