You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-1
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,7 @@ pip install dbt-clickhouse
31
31
-[x] Table materialization
32
32
-[x] View materialization
33
33
-[x] Incremental materialization
34
+
-[x] Microbatch incremental materialization
34
35
-[x] Materialized View materializations (uses the `TO` form of MATERIALIZED VIEW, experimental)
35
36
-[x] Seeds
36
37
-[x] Sources
@@ -114,13 +115,23 @@ your_profile_name:
114
115
| primary_key | Like order_by, a ClickHouse primary key expression. If not specified, ClickHouse will use the order by expression as the primary key ||
115
116
| unique_key | A tuple of column names that uniquely identify rows. Used with incremental models for updates. ||
116
117
| inserts_only | If set to True for an incremental model, incremental updates will be inserted directly to the target table without creating intermediate table. It has been deprecated in favor of the `append` incremental `strategy`, which operates in the same way. If `inserts_only` is set, `incremental_strategy` is ignored. ||
117
-
| incremental_strategy | Incremental model update strategy: `delete+insert`, `append`, or `insert_overwrite`. See the following Incremental Model Strategies|`default`|
118
+
| incremental_strategy | Incremental model update strategy: `delete+insert`, `append`, `insert_overwrite`, or `microbatch`. See the following Incremental Model Strategies |`default`|
118
119
| incremental_predicates | Additional conditions to be applied to the incremental materialization (only applied to `delete+insert` strategy ||
119
120
| settings | A map/dictionary of "TABLE" settings to be used to DDL statements like 'CREATE TABLE' with this model ||
120
121
| query_settings | A map/dictionary of ClickHouse user level settings to be used with `INSERT` or `DELETE` statements in conjunction with this model ||
121
122
| 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. ||
122
123
| indexes | A list of indexes to create, available only for `table` materialization. For examples look at ([#397](https://github.com/ClickHouse/dbt-clickhouse/pull/397)) ||
| event_time | The column indicating "at what time did the row occur." Required for your microbatch model and any direct parents that should be filtered. ||
130
+
| begin | The "beginning of time" for the microbatch model. This is the starting point for any initial or full-refresh builds. For example, a daily-grain microbatch model run on 2024-10-01 with begin = '2023-10-01 will process 366 batches (it's a leap year!) plus the batch for "today." ||
131
+
| batch_size | The granularity of your batches. Supported values are `hour`, `day`, `month`, and `year`||
132
+
| lookback | Process X batches prior to the latest bookmark to capture late-arriving records. | 1 |
133
+
| concurrent_batches | Overrides dbt's auto detect for running batches concurrently (at the same time). Read more about [configuring concurrent batches](https://docs.getdbt.com/docs/build/incremental-microbatch#configure-concurrent_batches). Setting to true runs batches concurrently (in parallel). false runs batches sequentially (one after the other). ||
134
+
124
135
## Column Configuration
125
136
126
137
| Option | Description | Default if any |
@@ -221,6 +232,20 @@ caveats to using this strategy:
221
232
incremental predicates should only include sub-queries on data that will not be modified during the incremental
222
233
materialization.
223
234
235
+
### The Microbatch Strategy (Requires dbt-core >= 1.9)
236
+
237
+
The incremental strategy `microbatch` has been a dbt-core feature since version 1.9, designed to handle large
238
+
time-series data transformations efficiently. In dbt-clickhouse, it builds on top of the existing `delete_insert`
239
+
incremental strategy by splitting the increment into predefined time-series batches based on the `event_time` and
240
+
`batch_size` model configurations.
241
+
242
+
Beyond handling large transformations, microbatch provides the ability to:
0 commit comments