-
Notifications
You must be signed in to change notification settings - Fork 975
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
504fb91
commit d05ce08
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
website/docs/reference/resource-properties/concurrent_batches.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
title: "concurrent_batches" | ||
resource_types: [models] | ||
datatype: model_name | ||
description: "concurrent_batches - Read this in-depth guide to learn about concurrent_batches in dbt." | ||
--- | ||
|
||
<Tabs> | ||
<TabItem value="Project file"> | ||
|
||
|
||
<File name='dbt_project.yml'> | ||
|
||
```yaml | ||
models: | ||
+concurrent_batches: True | ||
``` | ||
</File> | ||
</TabItem> | ||
<TabItem value="sql file"> | ||
<File name='models/my_model.sql'> | ||
```sql | ||
{{ | ||
config( | ||
materialized='incremental', | ||
concurrent_batches=True, | ||
incremental_strategy='microbatch' | ||
... | ||
) | ||
}} | ||
select ... | ||
``` | ||
|
||
</File> | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
## Definition | ||
|
||
`concurrent_batches` is an override which allows users to decide whether or not they want to run their batches in parallel or sequentially (one at a time). | ||
|
||
## [`{{ this }}`](/reference/dbt-jinja-functions/this) | ||
|
||
dbt automatically detects if a model uses the `{{ this }}` Jinja function. When `{{ this }}` is referenced, the batches execute sequentially because `{{ this }}` points to the current model's database relation, and referencing the same relation can lead to conflicts. If `{{ this }}` is not detected, and the concurrent_batches value is not explicitly set (along with other conditions being met), the batches will execute in parallel. | ||
Check warning on line 51 in website/docs/reference/resource-properties/concurrent_batches.md GitHub Actions / vale[vale] website/docs/reference/resource-properties/concurrent_batches.md#L51
Raw output
|
||
|
||
For more information, refer to [how batch execution works](/docs/build/incremental-microbatch#how-parallel-batch-execution-works) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters