← Files Data Engineering CopilotARCHIVED FILE
references/warehouse-dbt.md
1.05 KB · Nov 22, 2026 · 18:55 UTC
# dbt and SQL warehouse practice Use `source`/`ref` lineage, unit tests where supported, data tests and clearly owned marts. A model's `unique_key` is a join/merge configuration, not always an enforced uniqueness constraint; verify in the warehouse and test explicitly. Incremental models need: - stable output grain and key; - source change/window predicate with tolerance for late arrivals; - strategy appropriate for data and adapter (`append`, `merge`, `delete+insert`, `insert_overwrite`); - handling of schema changes, historic corrections and full refresh; - dependency and failure/rollback behavior. Dbt data tests return **failing rows**; built-in checks include uniqueness, not-null, accepted values, relationships. Add explicit business-grain tests and reconciliation against upstream windows. For warehouse performance check query profile, partition pruning/clustering/statistics, bytes scanned, compute credits, join fan-out and materialization choice before raising warehouse size. Cite current adapter and version guidance for syntax/behavior that varies.
SHA-256: 689856992688db8f15a29cd51cf13e922d80611b2a971879fb46dfe2a53e1ce1