Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created concurrent batches page #6601

Merged
merged 32 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d05ce08
Created concurrent batches page
nataliefiann Dec 5, 2024
db35f09
Merge branch 'nfiann-rbip' into new-branch-name
mirnawong1 Dec 6, 2024
9dba8c4
Merge branch 'nfiann-rbip' into new-branch-name
mirnawong1 Dec 6, 2024
3cc8a37
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
d291fab
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
14f61ec
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
e2cc0b2
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
9002879
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
d023f84
Merge branch 'nfiann-rbip' into new-branch-name
mirnawong1 Dec 6, 2024
1fb7062
Update incremental-microbatch.md
mirnawong1 Dec 6, 2024
ff9ae29
Merge branch 'nfiann-rbip' into new-branch-name
mirnawong1 Dec 6, 2024
4bf5637
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
00fb5ee
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
9048883
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
784adfc
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
4a0557b
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
0872a61
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
f6c63cb
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
4082870
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
96739ec
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
904df2b
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
13c01af
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
0be33fd
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
08b0bdb
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann Dec 6, 2024
8cdd951
Merge branch 'nfiann-rbip' into new-branch-name
nataliefiann Dec 6, 2024
dbee07f
Updated doc
nataliefiann Dec 6, 2024
d8f9529
Merge branch 'new-branch-name' of https://github.com/dbt-labs/docs.ge…
nataliefiann Dec 6, 2024
8d75934
Updated doc with closing tags
nataliefiann Dec 6, 2024
a878e1c
Apply suggestions from code review
runleonarun Dec 6, 2024
0a3ac40
Apply suggestions from code review
runleonarun Dec 6, 2024
e27c337
Apply suggestions from code review
runleonarun Dec 6, 2024
9de3005
Merge branch 'nfiann-rbip' into new-branch-name
runleonarun Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions website/docs/reference/resource-properties/concurrent_batches.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
title: "concurrent_batches"
resource_types: [models]
datatype: model_name
description: "Learn about concurrent_batches in dbt."
---

nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
:::note

Available in dbt Core v1.9+ or the [dbt Cloud "Latest" release tracks](/docs/dbt-versions/cloud-release-tracks).

:::

<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 you to decide whether or not you want to run batches in parallel or sequentially (one at a time).

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

nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
By default, dbt auto-detects whether batches can run in parallel for microbatch models. However, you can override dbt's detection by setting the `concurrent_batches` config to `false` in your `dbt_project.yml` or model `.sql` file to specify parallel or sequential execution, given you meet these conditions:
* You've configured a microbatch incremental strategy.
* You're working with cumulative metrics or any logic that depends on batch order.

runleonarun marked this conversation as resolved.
Show resolved Hide resolved
Set `concurrent_batches` config to `false` to ensure batches are processed sequentially. For example:

nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
<File name='dbt_project.yml'>

```yaml
models:
my_project:
cumulative_metrics_model:
+concurrent_batches: false
```
</File>


<File name='models/my_model.sql'>

```sql
{{
config(
materialized='incremental',
incremental_strategy='microbatch'
concurrent_batches=false
)
}}
select ...

nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
```
</File>


1 change: 1 addition & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,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
Loading