Skip to content

Commit

Permalink
Created concurrent batches page
Browse files Browse the repository at this point in the history
  • Loading branch information
nataliefiann committed Dec 5, 2024
1 parent 504fb91 commit d05ce08
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
55 changes: 55 additions & 0 deletions website/docs/reference/resource-properties/concurrent_batches.md
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

View workflow job for this annotation

GitHub Actions / vale

[vale] website/docs/reference/resource-properties/concurrent_batches.md#L51

[custom.Typos] Oops there's a typo -- did you really mean 'concurrent_batches'?
Raw output
{"message": "[custom.Typos] Oops there's a typo -- did you really mean 'concurrent_batches'? ", "location": {"path": "website/docs/reference/resource-properties/concurrent_batches.md", "range": {"start": {"line": 51, "column": 310}}}, "severity": "WARNING"}

For more information, refer to [how batch execution works](/docs/build/incremental-microbatch#how-parallel-batch-execution-works)


1 change: 1 addition & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ const sidebarSettings = {
"reference/resource-configs/materialized",
"reference/resource-configs/on_configuration_change",
"reference/resource-configs/sql_header",
"reference/resource-properties/concurrent_batches",
],
},
{
Expand Down

0 comments on commit d05ce08

Please sign in to comment.