dbt Information Schema 테이블

dbt Information Schema 테이블 (dbt Information Schema tables)

dbt Information Schema는 dbt 프로젝트의 모든 리소스에 대한 메타데이터를 제공하는 계약된 인터페이스예요. --generate-info-schema 플래그와 함께 dbt build, dbt run, dbt compile, dbt parse로 생성되며, info_schema() 매크로로 checks에서 조회할 수 있어요.

출처: 문서

본문

v2에서 사용 가능 — dbt Information Schema는 dbt 프로젝트의 모든 리소스에 대한 메타데이터를 제공하는 계약된 인터페이스예요. Information Schema 테이블은 --generate-info-schema 플래그와 함께 dbt build, dbt run, dbt compile, dbt parse를 실행해 생성돼요.

테이블 (Tables)

dbt Information Schema v1은 다음 네임스페이스에 걸쳐 테이블을 생성해요:

  • dbt: 프로젝트의 구조, 리소스, 구성을 담은 메타데이터를 포함해요. "당신의 프로젝트는 무엇인가?"라는 질문에 답해요.
  • dbt_rt: 런타임 실행 데이터를 포함해요. "당신의 프로젝트를 실행했을 때 무슨 일이 있었나?"라는 질문에 답해요.

dbt 네임스페이스

dbt 네임스페이스 테이블은 프로젝트의 구조, 리소스, 구성에 대한 메타데이터를 포함해요.

Table Description
dbt.dag_nodes All DAG participants with unique_id and resource_type
dbt.project Project-level metadata
dbt.packages Installed packages, one row per package
dbt.project_vars Project variables, one row per (project scope, variable name)
dbt.project_env_vars Environment variables used in the project
dbt.models All models
dbt.seeds All seeds
dbt.sources All sources
dbt.snapshots All snapshots
dbt.functions All user-defined functions
dbt.analyses All analyses
dbt.hooks All on-run-start and on-run-end hook operations
dbt.checks All checks
dbt.data_tests All data tests (generic and singular)
dbt.unit_tests All unit tests
dbt.macros All macros
dbt.groups All groups
dbt.exposures All exposures
dbt.metrics All metrics
dbt.docs_blocks All docs blocks
dbt.saved_queries All saved queries
dbt.semantic_models All semantic models
dbt.semantic_entities Semantic model entities
dbt.semantic_measures Semantic model measures
dbt.semantic_dimensions Semantic model dimensions
dbt.semantic_relationships Relationships between semantic models
dbt.time_spines Time spine definitions
dbt.classifiers Resource classifiers
dbt.edges DAG edges (parent → child)
dbt.node_columns Column names, types, and descriptions for all nodes
dbt.column_lineage Column-level lineage (populated with --static-analysis strict)

dbt_rt 네임스페이스

dbt_rt 네임스페이스 테이블은 런타임 실행 데이터를 포함해요. 이 테이블들은 parse-time 검사에는 사용할 수 없어요.

Table Description
dbt_rt.invocations One row per dbt invocation
dbt_rt.run_results Results for each node in each invocation
dbt_rt.run_results_latest View of the most recent run result per node
dbt_rt.relations Warehouse catalog data for each materialized relation (populated with --write-catalog)
dbt_rt.freshness Freshness check results for sources and models; resource_type indicates whether a row is a source or model
dbt_rt.diagnostics Diagnostic data from invocations
dbt_rt.adapter_queries Adapter queries issued during invocations

checks에서 사용 가능한 컬럼 (Columns available for checks)

check에서 {{ info_schema() }} 매크로를 사용할 때, parse time에 해석되는 컬럼에만 접근할 수 있어요. dbt는 이러한 컬럼을 Information Schema 테이블과 같은 이름의 뷰를 통해 제공해요. dbt. 접두사 없이 그 이름을 매크로에 전달하세요.

target/info_schema/v1/의 전체 테이블은 더 많은 컬럼을 가질 수 있어요. dbt show --inline과 함께 매크로를 사용하면 모든 컬럼에 접근할 수 있어요.

View Columns
models unique_id, name, resource_type, package_name, original_file_path, fqn, alias, description, node_language, database_name, schema_name, relation_name, identifier, enabled, materialized, config, access, group, contract_enforced, version, latest_version, deprecation_date, primary_key, properties_yml_file_path, tags, meta, ingested_at
seeds unique_id, name, resource_type, package_name, original_file_path, fqn, alias, description, node_language, database_name, schema_name, relation_name, identifier, enabled, materialized, config, access, group, contract_enforced, version, latest_version, deprecation_date, primary_key, properties_yml_file_path, tags, meta, ingested_at
snapshots unique_id, name, resource_type, package_name, original_file_path, fqn, alias, description, node_language, database_name, schema_name, relation_name, identifier, enabled, materialized, config, access, group, contract_enforced, version, latest_version, deprecation_date, primary_key, properties_yml_file_path, tags, meta, raw_code, ingested_at
functions unique_id, name, resource_type, package_name, original_file_path, fqn, alias, description, node_language, database_name, schema_name, relation_name, identifier, enabled, materialized, config, access, group, contract_enforced, version, latest_version, deprecation_date, primary_key, properties_yml_file_path, tags, meta, raw_code, ingested_at
analyses unique_id, name, resource_type, package_name, original_file_path, fqn, alias, description, node_language, database_name, schema_name, relation_name, identifier, enabled, materialized, config, access, group, contract_enforced, version, latest_version, deprecation_date, primary_key, properties_yml_file_path, tags, meta, raw_code, ingested_at
hooks unique_id, name, resource_type, package_name, original_file_path, fqn, alias, description, node_language, database_name, schema_name, relation_name, identifier, enabled, materialized, config, access, group, contract_enforced, version, latest_version, deprecation_date, primary_key, properties_yml_file_path, tags, meta, raw_code, ingested_at
checks unique_id, name, resource_type, package_name, original_file_path, fqn, alias, description, node_language, database_name, schema_name, relation_name, identifier, enabled, materialized, config, access, group, contract_enforced, version, latest_version, deprecation_date, primary_key, properties_yml_file_path, tags, meta, raw_code, ingested_at
sources unique_id, name, resource_type, package_name, original_file_path, fqn, alias, description, node_language, database_name, schema_name, relation_name, identifier, enabled, materialized, config, access, group, contract_enforced, version, latest_version, deprecation_date, primary_key, properties_yml_file_path, tags, meta, source_name, source_description, loader, loaded_at_field, ingested_at
data_tests unique_id, name, package_name, original_file_path, fqn, description, database_name, schema_name, relation_name, enabled, materialized, config, tags, meta, group, properties_yml_file_path, test_name, test_definition_package, arguments, column_name, node_unique_id, severity, warn_if, error_if, fail_calc, store_failures, store_failures_as, ingested_at
unit_tests unique_id, name, model, description, package_name, original_file_path, fqn, given, expect, overrides, versions, ingested_at
node_columns node_unique_id, column_name, data_type_declared, description, tags, ingested_at
dag_nodes unique_id, resource_type, ingested_at — one row per enabled resource that participates in the DAG, including exposures, metrics, and unit tests
edges parent_unique_id, child_unique_id, ingested_at
macros unique_id, name, package_name, original_file_path, macro_sql, description, depends_on_macros, arguments, docs_show, properties_yml_file_path, meta, created_at, ingested_at
docs_blocks unique_id, name, package_name, original_file_path, content, ingested_at
groups unique_id, name, description, owner_name, owner_email, ingested_at
exposures unique_id, name, exposure_type, label, owner_name, owner_email, url, maturity, description, package_name, original_file_path, fqn, depends_on, tags, created_at, ingested_at
metrics unique_id, name, label, metric_type, description, package_name, original_file_path, fqn, type_params, metric_filter, time_granularity, input_metric_names, group, tags, meta, config, created_at, ingested_at
saved_queries unique_id, name, label, description, package_name, original_file_path, fqn, query_params, exports, depends_on, group, tags, created_at, ingested_at
semantic_models unique_id, name, model, label, description, fqn, node_relation, primary_entity, defaults, group, created_at, ingested_at
semantic_entities unique_id, name, entity_type, description, label, entity_role, expr, ingested_at
semantic_measures unique_id, name, agg, description, label, expr, create_metric, agg_time_dimension, agg_params, non_additive_dimension, ingested_at
semantic_dimensions unique_id, name, dimension_type, description, label, expr, is_partition, time_granularity, validity_params, ingested_at
time_spines unique_id, primary_column, primary_granularity, custom_granularities, node_relation, ingested_at
project project_name, dbt_version, adapter_type, git_sha, git_branch, git_uncommitted_changes, ingested_at
packages package_name, ingested_at
project_vars project_name, var_name, var_value, ingested_at — a package-scoped var appears on that package's project_name
project_env_vars env_var_name, ingested_at

더 알아보기 (Learn more)