Skip to content

Commit f974351

Browse files
committed
Improve concepts explanation. Explain better table vs model configurations
1 parent 43d8f41 commit f974351

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

docs/integrations/data-ingestion/etl-tools/dbt/features-and-configurations.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ dbt relies on a read-after-insert consistency model. This is not compatible with
131131

132132
## General information about features {#general-information-about-features}
133133

134-
### General table configurations {#general-table-configurations}
134+
### General model configurations {#general-model-configurations}
135+
136+
The following table shows configurations shared by some of the available materializations. For in-depth information about each configuration, see the [dbt documentation](https://docs.getdbt.com/category/general-configs):
135137

136138
| Option | Description | Default if any |
137139
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
@@ -140,12 +142,11 @@ dbt relies on a read-after-insert consistency model. This is not compatible with
140142
| partition_by | A partition is a logical combination of records in a table by a specified criterion. The partition key can be any expression from the table columns. | |
141143
| sharding_key | Sharding key determines the destination server when inserting into distributed engine table. The sharding key can be random or as an output of a hash function | `rand()`) |
142144
| primary_key | Like order_by, a ClickHouse primary key expression. If not specified, ClickHouse will use the order by expression as the primary key | |
143-
| unique_key | A tuple of column names that uniquely identify rows. Used with incremental models for updates. | |
144145
| settings | A map/dictionary of "TABLE" settings to be used to DDL statements like 'CREATE TABLE' with this model | |
145146
| query_settings | A map/dictionary of ClickHouse user level settings to be used with `INSERT` or `DELETE` statements in conjunction with this model | |
146147
| ttl | A TTL expression to be used with the table. The TTL expression is a string that can be used to specify the TTL for the table. | |
147-
| indexes | A list of [data skipping indexes to create](/optimize/skipping-indexes). Check below for more information. | |
148-
| sql_security | Allow you to specify which ClickHouse user to use when executing the view's underlying query. `SQL SECURITY` [has two legal values](/sql-reference/statements/create/view#sql_security)`definer` `invoker`. | |
148+
| indexes | A list of [data skipping indexes](/optimize/skipping-indexes) to create. See [About data skipping indexes](#data-skipping-indexes) for details. | |
149+
| sql_security | The ClickHouse user to use when executing the view's underlying query. [Accepted values]((/sql-reference/statements/create/view#sql_security)): `definer`, `invoker`. | |
149150
| definer | If `sql_security` was set to `definer`, you have to specify any existing user or `CURRENT_USER` in the `definer` clause. | |
150151
| projections | A list of [projections](/data-modeling/projections) to be created. Check [About projections](#projections) for details. | |
151152

@@ -191,6 +192,8 @@ You can add [projections](/data-modeling/projections) to `table` and `distribute
191192
| EmbeddedRocksDB | https://clickhouse.com/docs/en/engines/table-engines/integrations/embedded-rocksdb |
192193
| Hive | https://clickhouse.com/docs/en/engines/table-engines/integrations/hive |
193194

195+
**Note**: For materialized views, all *MergeTree engines are supported.
196+
194197
### Experimental supported table engines {#experimental-supported-table-engines}
195198

196199
| Type | Details |

docs/integrations/data-ingestion/etl-tools/dbt/index.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,31 +48,23 @@ All features up to dbt-core 1.9 are supported. We will soon add the features add
4848

4949
This adapter is still not available for use inside [dbt Cloud](https://docs.getdbt.com/docs/dbt-cloud/cloud-overview), but we expect to make it available soon. Please reach out to support to get more information on this.
5050

51-
## Concepts {#concepts}
51+
## dbt concepts and supported materializations {#concepts-and-supported-materializations}
5252

5353
dbt introduces the concept of a model. This is defined as a SQL statement, potentially joining many tables. A model can be "materialized" in a number of ways. A materialization represents a build strategy for the model's select query. The code behind a materialization is boilerplate SQL that wraps your SELECT query in a statement in order to create a new or update an existing relation.
5454

55-
dbt provides 4 types of materialization:
55+
dbt provides 5 types of materialization. All of them are supported by `dbt-clickhouse`:
5656

57-
* **view** (default): The model is built as a view in the database.
58-
* **table**: The model is built as a table in the database.
59-
* **ephemeral**: The model is not directly built in the database but is instead pulled into dependent models as common table expressions.
57+
* **view** (default): The model is built as a view in the database. At ClickHouse this is built as a [view](/sql-reference/statements/create/view).
58+
* **table**: The model is built as a table in the database. At ClickHouse this is built as a [table](/sql-reference/statements/create/table).
59+
* **ephemeral**: The model is not directly built in the database but is instead pulled into dependent models as CTEs (Common Table Expressions).
6060
* **incremental**: The model is initially materialized as a table, and in subsequent runs, dbt inserts new rows and updates changed rows in the table.
61+
* **materialized view**: The model is built as a materialized view in the database. At ClickHouse this is built as a [materialized view](/sql-reference/statements/create/view#materialized-view).
6162

6263
Additional syntax and clauses define how these models should be updated if their underlying data changes. dbt generally recommends starting with the view materialization until performance becomes a concern. The table materialization provides a query time performance improvement by capturing the results of the model's query as a table at the expense of increased storage. The incremental approach builds on this further to allow subsequent updates to the underlying data to be captured in the target table.
6364

64-
The[ current adapter](https://github.com/silentsokolov/dbt-clickhouse) for ClickHouse supports also support **materialized view**, **dictionary**, **distributed table** and **distributed incremental** materializations. The adapter also supports dbt[ snapshots](https://docs.getdbt.com/docs/building-a-dbt-project/snapshots#check-strategy) and [seeds](https://docs.getdbt.com/docs/building-a-dbt-project/seeds).
65+
The[ current adapter](https://github.com/silentsokolov/dbt-clickhouse) for ClickHouse supports also support **dictionary**, **distributed table** and **distributed incremental** materializations. The adapter also supports dbt [snapshots](https://docs.getdbt.com/docs/building-a-dbt-project/snapshots#check-strategy) and [seeds](https://docs.getdbt.com/docs/building-a-dbt-project/seeds).
6566

66-
### Details about supported materializations {#details-about-supported-materializations}
67-
68-
| Type | Supported? | Details |
69-
|-----------------------------|------------|----------------------------------------------------------------------------------------------------------------------------------|
70-
| view materialization | YES | Creates a [view](https://clickhouse.com/docs/en/sql-reference/table-functions/view/). |
71-
| table materialization | YES | Creates a [table](https://clickhouse.com/docs/en/operations/system-tables/tables/). See below for the list of supported engines. |
72-
| incremental materialization | YES | Creates a table if it doesn't exist, and then writes only updates to it. |
73-
| ephemeral materialized | YES | Creates a ephemeral/CTE materialization. This does model is internal to dbt and does not create any database objects |
74-
75-
The following are [experimental features](https://clickhouse.com/docs/en/beta-and-experimental-features) in ClickHouse:
67+
The following are [experimental features](https://clickhouse.com/docs/en/beta-and-experimental-features) in `dbt-clickhouse`:
7668

7769
| Type | Supported? | Details |
7870
|-----------------------------------------|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

0 commit comments

Comments
 (0)