---
title: "dbt YAML columns missing from the warehouse | Metacenta"
description: "A column declared in dbt YAML that the built table does not have makes every test on it check nothing. How we compare YAML to the warehouse, and the fix."
url: "https://metacenta.com/rules/catalog-phantom-column"
updated: "2026-10-14"
tokens: 563
---

Modelling correctness · rule catalog-phantom-column

# dbt YAML columns missing from the warehouse

A Metacenta review checks this under the rule **Declared columns exist in the warehouse**. Everything below applies whether or not you ever commission one.

## What this rule checks

This rule flags models whose schema YAML declares a column the built relation does not have. Names are compared ignoring case. A relation for which the catalog lists no columns is skipped, as is a model not in the catalog.

## Why it matters

A test or contract on a missing column protects nothing. The documentation also describes a shape the data doesn't have, so readers plan queries against columns that aren't there.

## How to fix it

**Reconcile the declared columns with the ones that exist.** Select the column in the model, or remove it from the schema YAML along with the tests that name it.

Before:

```yaml
models:
  - name: fct_orders
    columns:
      - name: order_id
      - name: discount_code
        data_tests:
          - not_null
```

After:

```yaml
models:
  - name: fct_orders
    columns:
      - name: order_id
```

## When it is fine to leave

A column added to YAML ahead of the model change that selects it is fine for as long as that change is in flight. Build it before the tests are relied on.

## What we need to check it

`manifest.json` and `catalog.json`, generated together by `dbt docs generate`. If the catalog is older than the manifest, a missing column could be an unbuilt change, so the rule declines.

[Ask about a review](https://metacenta.com/enquire?src=rule-catalog-phantom-column&via=md)

## Related pages

- [dbt incremental models: how unique_key works](https://metacenta.com/rules/incremental-without-unique-key)
- [dbt public models with no enforced contract](https://metacenta.com/rules/public-model-without-contract)
- [dbt sources declared twice for one table](https://metacenta.com/rules/duplicate-source)
- [dbt staging models: how to set up the staging layer](https://metacenta.com/rules/staging-depends-on-staging)
- [A sample review, as a client reads it](https://metacenta.com/sample)
- [All published rules](https://metacenta.com/rules)
- [How a review is assessed](https://metacenta.com/standard)
