> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> Status of the ClickHouse adapter in dbt OSS, dbt v2 and the dbt platform

# dbt OSS, v2 and Platform (Beta)

export const BetaBadge = ({link, galaxyTrack, galaxyEvent}) => {
  if (link) {
    return <a href={link} target="_blank" rel="noopener noreferrer" className="betaBadge" onClick={galaxyTrack && galaxyEvent ? galaxyOnClick(galaxyEvent) : undefined}>
                <span>Beta</span>
            </a>;
  }
  return <a href="https://clickhouse.com/docs/reference/settings/beta-and-experimental-features#beta-features" className="betaBadge">
            <span>Beta feature</span>
        </a>;
};

export const ClickHouseSupportedBadge = () => {
  return <div className="ClickHouseSupportedBadge">
            <div className="ClickHouseSupportedIcon">
                <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <path d="M1.30762 1.39073C1.30762 1.3103 1.37465 1.22986 1.46849 1.22986H2.64824C2.72868 1.22986 2.80912 1.29689 2.80912 1.39073V14.4886C2.80912 14.5691 2.74209 14.6495 2.64824 14.6495H1.46849C1.38805 14.6495 1.30762 14.5825 1.30762 14.4886V1.39073Z" fill="currentColor" />
                    <path d="M4.2832 1.39073C4.2832 1.3103 4.35023 1.22986 4.44408 1.22986H5.62383C5.70427 1.22986 5.7847 1.29689 5.7847 1.39073V14.4886C5.7847 14.5691 5.71767 14.6495 5.62383 14.6495H4.44408C4.36364 14.6495 4.2832 14.5825 4.2832 14.4886V1.39073Z" fill="currentColor" />
                    <path d="M7.25977 1.39073C7.25977 1.3103 7.3268 1.22986 7.42064 1.22986H8.60039C8.68083 1.22986 8.76127 1.29689 8.76127 1.39073V14.4886C8.76127 14.5691 8.69423 14.6495 8.60039 14.6495H7.42064C7.3402 14.6495 7.25977 14.5825 7.25977 14.4886V1.39073Z" fill="currentColor" />
                    <path d="M10.2354 1.39073C10.2354 1.3103 10.3024 1.22986 10.3962 1.22986H11.576C11.6564 1.22986 11.7369 1.29689 11.7369 1.39073V14.4886C11.7369 14.5691 11.6698 14.6495 11.576 14.6495H10.3962C10.3158 14.6495 10.2354 14.5825 10.2354 14.4886V1.39073Z" fill="currentColor" />
                    <path d="M13.2256 6.6057C13.2256 6.52526 13.2926 6.44482 13.3865 6.44482H14.5662C14.6466 6.44482 14.7271 6.51186 14.7271 6.6057V9.27354C14.7271 9.35398 14.6601 9.43442 14.5662 9.43442H13.3865C13.306 9.43442 13.2256 9.36739 13.2256 9.27354V6.6057Z" fill="currentColor" />
                </svg>
            </div>
            ClickHouse Supported
        </div>;
};

<ClickHouseSupportedBadge />

<BetaBadge link="https://github.com/ClickHouse/dbt-clickhouse/issues/660" />

dbt is being rebuilt on a new engine, and ClickHouse is part of that from the start. ClickHouse now works with the new Rust-based dbt engine, in both dbt OSS and dbt v2, and for the first time you can connect to ClickHouse from the dbt platform. Your project does not change: the same models, tests and profiles that run on dbt Core 1.x today run on the new engine; only the binary is different.

ClickHouse is the first community adapter on dbt OSS, dbt v2 and the dbt platform. dbt's own first-party adapters are launching alongside us; we are the first from outside dbt Labs. The dbt Core 1.x Python adapter, `dbt-clickhouse`, is not going away: we keep it current with dbt 1.x releases and maintain both adapters in parallel.

<Warning>
  **Not production-ready.** The ClickHouse adapter for dbt OSS and dbt v2, and the dbt platform connection, are not yet generally available (GA). Use them only in development or staging projects.
</Warning>

<Note>
  **The dbt Core 1.x documentation also applies to dbt OSS and dbt v2.** The adapter behaves the same way on both engines: the profiles, model configs, materializations and macros described in the other dbt pages work unchanged on dbt OSS, dbt v2 and the dbt platform. The exceptions are documented in the [v1 vs v2 parity](#parity) table below.
</Note>

<Note>
  **dbt OSS** is the open-source (Apache 2.0) build of the v2 engine. See [terminology and availability](#terminology) for how it relates to dbt v2 and the dbt platform.
</Note>

Live status is tracked in [ClickHouse/dbt-clickhouse#660](https://github.com/ClickHouse/dbt-clickhouse/issues/660) (v2 parity with v1, one sub-issue per area) and [ClickHouse/dbt-clickhouse#555](https://github.com/ClickHouse/dbt-clickhouse/issues/555) (dbt v2).

<h4 id="request-access">
  Try ClickHouse in the dbt platform
</h4>

If you're interested in testing the private beta, sign up through [dbt Labs' private beta form](https://docs.google.com/forms/d/e/1FAIpQLScjHwRchnKarq_RpNM7hATjphNFxqBEePmAwRtSpMWG1snGHA/viewform). The form belongs to dbt Labs, so the information you submit goes to dbt Labs, not to ClickHouse. Once enabled, follow [Connect ClickHouse](https://docs.getdbt.com/docs/platform/connect-data-platform/connect-clickhouse) in the dbt documentation to set up the connection.

<h2 id="terminology">
  Terminology and availability
</h2>

dbt is available in several forms, and the same adapter can run in more than one of them. This table explains each name and the current level of ClickHouse support.

| Term             | What it is                                                                                                                                                                                                                                                          | ClickHouse status and how to get it                                                                                                                                                                                                                                                                                                                                    |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **dbt Core 1.x** | The Python-based dbt engine, open source (Apache 2.0). Our adapter is `dbt-clickhouse`, maintained in the [ClickHouse GitHub organization](https://github.com/ClickHouse/dbt-clickhouse) and installed alongside `dbt-core`.                                        | **GA, maintained.** Keeps receiving releases in parallel with dbt v2.                                                                                                                                                                                                                                                                                                  |
| **dbt OSS**      | Full rewrite of the dbt engine in Rust, open source (Apache 2.0). This new version includes all v1 features plus several performance improvements.                                                                                                                  | **Beta.** Follow the [dbt v2 upgrade guide](https://docs.getdbt.com/docs/dbt-versions/core-upgrade/upgrading-to-v2) and the [ClickHouse setup page for v2](https://docs.getdbt.com/docs/local/connect-data-platform/clickhouse-setup?version=2) in the dbt documentation. The ClickHouse adapter ships inside the dbt binary; there is no separate package to install. |
| **dbt v2**       | dbt OSS plus additional features from dbt Labs: SQL comprehension, static analysis, LSP, a VS Code extension and column awareness. Closed source, licensed under the [dbt Product Licensing Agreement](https://www.getdbt.com/dbt-fusion-engine-license-agreement). | **Beta.** The adapter runs with the v2 binary, but the new SQL features are not available for ClickHouse yet.                                                                                                                                                                                                                                                          |
| **dbt platform** | Hosted dbt, formerly dbt Cloud: Studio IDE, scheduled jobs, environments, Catalog, Semantic Layer. The platform runs dbt v2 only, so ClickHouse in the platform means the v2 adapter.                                                                               | **Private Beta.** See [how to request access](#request-access). Setup: [Connect ClickHouse](https://docs.getdbt.com/docs/platform/connect-data-platform/connect-clickhouse) in the dbt documentation.                                                                                                                                                                  |

<h2 id="beta-status">
  Beta status
</h2>

We measure the dbt v2 adapter against the dbt Core 1.x integration test suite of `dbt-clickhouse`. Beta means that core dbt workflows and the ClickHouse Cloud feature set work with documented limits; full v1 parity and self-managed cluster support come after.

**Today,** the adapter passes more than 81% of the full v1 suite and 92% of the tests that apply to ClickHouse Cloud. Every materialization is at parity (`view`, `table`, `incremental`, `materialized_view`, `dictionary`, `snapshot`, `seed`, `ephemeral`), with the full set of table configs, model contracts, data and unit tests, docs persistence, `clickhouse_s3source()` and the dbt Core 1.x connection settings. The remaining failures relate to the self-managed cluster work listed below and a handful of engine-side differences. See [v1 vs v2 parity](#parity) for the feature-by-feature picture.

**Next steps**: `ON CLUSTER` DDL and the distributed materializations for self-managed clusters, grants, `dbt clone`, `dbt source freshness` from table metadata, fixes for the remaining bugs and passing the full v1 test suite to ensure full parity. The progress of all of these is tracked in [ClickHouse/dbt-clickhouse#660](https://github.com/ClickHouse/dbt-clickhouse/issues/660), with one sub-issue per area.

GA is on the roadmap and will come soon. We'll update the docs once it's ready.

<h3 id="out-of-scope">
  Out of scope for Beta
</h3>

In addition to the v1 parity gaps listed below, a few features exclusive to v2 are outside the current scope but will come soon:

* **Semantic Layer / MetricFlow.** ClickHouse support has not been added yet. Tracked in [dbt-labs/metricflow#2124](https://github.com/dbt-labs/metricflow/pull/2124).
* **ClickHouse SQL intelligence in dbt v2** (dialect-aware validation, static analysis, LSP, column awareness in the VS Code extension). The adapter runs with the dbt v2 binary today but doesn't include these features yet. Until then, static analysis is forced to `off` for ClickHouse projects and the engine writes no column-level lineage. Tracked in [#736](https://github.com/ClickHouse/dbt-clickhouse/issues/736).
* **Additional auth methods** beyond username and password in the dbt platform.

<h2 id="parity">
  v1 vs v2 parity
</h2>

The tables below compare the features available in `dbt-clickhouse` (v1) with their status in the dbt v2 adapter. Every feature listed is supported in v1 unless the notes say otherwise; the status column is for dbt v2 and applies equally to dbt OSS. The evolution of every pending item is tracked in [ClickHouse/dbt-clickhouse#660](https://github.com/ClickHouse/dbt-clickhouse/issues/660).

<Badge color="green">Supported</Badge> works today · <Badge color="yellow">Partial</Badge> works with limits · <Badge color="red">Not yet</Badge> pending implementation.

<h3 id="parity-materializations">
  Materializations
</h3>

| Feature                                        | What it does                                     | dbt v2                                 | Notes                                                                                                                           |
| ---------------------------------------------- | ------------------------------------------------ | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `view`                                         | Standard dbt view.                               | <Badge color="green">Supported</Badge> |                                                                                                                                 |
| `table`                                        | Full rebuild with engine and DDL options.        | <Badge color="green">Supported</Badge> |                                                                                                                                 |
| `incremental`                                  | Append or merge new rows.                        | <Badge color="green">Supported</Badge> |                                                                                                                                 |
| `materialized_view`                            | ClickHouse MV that transforms at insert time.    | <Badge color="green">Supported</Badge> |                                                                                                                                 |
| `dictionary`                                   | ClickHouse dictionary for key lookups and joins. | <Badge color="green">Supported</Badge> |                                                                                                                                 |
| `snapshot`                                     | Type 2 slowly changing dimensions.               | <Badge color="green">Supported</Badge> |                                                                                                                                 |
| `seed`                                         | Load CSVs as tables.                             | <Badge color="green">Supported</Badge> | Numeric column types are inferred as `Int64`/`Float64` instead of `Int32`/`Float32`; use `column_types` to set them explicitly. |
| `ephemeral`                                    | Inline CTE, no object created.                   | <Badge color="green">Supported</Badge> |                                                                                                                                 |
| `distributed_table`, `distributed_incremental` | Sharded tables behind a Distributed engine.      | <Badge color="red">Not yet</Badge>     |                                                                                                                                 |

<h3 id="parity-model-configuration">
  Model configuration
</h3>

| Feature                                           | What it does                                         | dbt v2                                 | Notes |
| ------------------------------------------------- | ---------------------------------------------------- | -------------------------------------- | ----- |
| Engine, `ORDER BY`, `PARTITION BY`, `PRIMARY KEY` | Core MergeTree DDL controls.                         | <Badge color="green">Supported</Badge> |       |
| TTL                                               | Row and column expiration.                           | <Badge color="green">Supported</Badge> |       |
| Table and query settings                          | Per-model `SETTINGS` on DDL and on the insert.       | <Badge color="green">Supported</Badge> |       |
| Projections, indexes, `sql_header`                | Secondary structures and prefix SQL.                 | <Badge color="green">Supported</Badge> |       |
| Model contracts and constraints                   | Column types and constraints enforced at build time. | <Badge color="green">Supported</Badge> |       |
| Schema evolution on incremental models            | `on_schema_change` adds or syncs columns.            | <Badge color="green">Supported</Badge> |       |
| Column `codec` and `ttl`                          | Per-column compression and expiration.               | <Badge color="green">Supported</Badge> |       |

<h3 id="parity-testing-and-docs">
  Testing and docs
</h3>

| Feature                     | What it does                                 | dbt v2                                 | Notes                                                                                                                                                                                               |
| --------------------------- | -------------------------------------------- | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Data tests                  | Generic and singular tests.                  | <Badge color="green">Supported</Badge> |                                                                                                                                                                                                     |
| Unit tests                  | Model logic against fixture inputs.          | <Badge color="green">Supported</Badge> |                                                                                                                                                                                                     |
| Docs persistence            | Descriptions written as ClickHouse comments. | <Badge color="yellow">Partial</Badge>  | Descriptions containing `;` fail.                                                                                                                                                                   |
| Catalog and docs generation | Column metadata for the docs site.           | <Badge color="green">Supported</Badge> |                                                                                                                                                                                                     |
| Column-level lineage        | Trace columns through the DAG.               | <Badge color="yellow">Partial</Badge>  | New in v2 via the SQL compiler, not available in v1. dbt platform lineage renders only with identifier quoting disabled in `dbt_project.yml`; engine-side lineage needs the ClickHouse SQL dialect. |

<h3 id="parity-cluster-and-cloud">
  Cluster and Cloud
</h3>

| Feature                             | What it does                                                           | dbt v2                                 | Notes                                                                                                                                                                                                          |
| ----------------------------------- | ---------------------------------------------------------------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ClickHouse Cloud                    | Recommended Beta setup.                                                | <Badge color="green">Supported</Badge> |                                                                                                                                                                                                                |
| Multi-replica consistency           | `select_sequential_consistency` and related read-after-write settings. | <Badge color="green">Supported</Badge> |                                                                                                                                                                                                                |
| `ON CLUSTER` and replicated engines | DDL fan-out on self-managed clusters.                                  | <Badge color="red">Not yet</Badge>     | Multi-node clusters in ClickHouse Cloud are supported. Other setups that require `ON CLUSTER` for DDL propagation are not supported yet. For self-managed deployments, test only against single-node clusters. |
| `EXCHANGE TABLES`                   | Atomic swap on rebuild.                                                | <Badge color="green">Supported</Badge> |                                                                                                                                                                                                                |
| Custom connection settings          | Profile-level `custom_settings`.                                       | <Badge color="green">Supported</Badge> |                                                                                                                                                                                                                |
| ClickHouse server version           | Minimum server version.                                                | <Badge color="green">Supported</Badge> | 25.3+ on both engines. Reading `UUID` columns on v2 requires 26.7+ (older servers cannot convert `UUID` to Arrow).                                                                                             |

<h3 id="parity-macros-and-operations">
  Macros and operations
</h3>

| Feature                       | What it does                                                         | dbt v2                                 | Notes                                     |
| ----------------------------- | -------------------------------------------------------------------- | -------------------------------------- | ----------------------------------------- |
| S3 table function macro       | `clickhouse_s3source()` reads S3 directly in a model.                | <Badge color="green">Supported</Badge> |                                           |
| Cross-database macros         | Helpers such as those in `dbt-utils`.                                | <Badge color="green">Supported</Badge> |                                           |
| Grants                        | `GRANT` statements from model config.                                | <Badge color="red">Not yet</Badge>     |                                           |
| `dbt clone`                   | Zero-copy `CLONE AS` between environments.                           | <Badge color="red">Not yet</Badge>     |                                           |
| Query ID in run results       | `query_id` in `adapter_response` for `system.query_log` correlation. | <Badge color="red">Not yet</Badge>     |                                           |
| `query-comment`               | Query comment configuration.                                         | <Badge color="red">Not yet</Badge>     | `query-comment: null` is not honored yet. |
| Catalog integration (Iceberg) | Materialize into external catalogs.                                  | <Badge color="red">Not yet</Badge>     | Not in v1 either; workarounds documented. |

<h3 id="parity-connectivity-and-auth">
  Connectivity and auth
</h3>

| Feature                    | What it does                                                                                                  | dbt v2                                 | Notes                                                    |
| -------------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------- | -------------------------------------------------------- |
| Protocol                   | How dbt talks to ClickHouse.                                                                                  | <Badge color="green">Supported</Badge> | ADBC (Arrow over HTTP) on v2; HTTP and native on v1.     |
| Username and password, TLS | Standard auth.                                                                                                | <Badge color="green">Supported</Badge> |                                                          |
| mTLS client certificates   | `client_cert`, `client_cert_key`, `verify`.                                                                   | <Badge color="red">Not yet</Badge>     | Driver work; the keys are accepted but ignored.          |
| HTTP client options        | `connect_timeout`, `send_receive_timeout`, `sync_request_timeout`, `compress_block_size`, `server_host_name`. | <Badge color="red">Not yet</Badge>     | Accepted but ignored; `server_host_name` is unavailable. |
