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 28 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
84 changes: 84 additions & 0 deletions website/docs/reference/resource-properties/concurrent_batches.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
title: "concurrent_batches"
resource_types: [models]
datatype: model_name
description: "concurrent_batches - Read this in-depth guide to learn about concurrent_batches in dbt."
runleonarun marked this conversation as resolved.
Show resolved Hide resolved
---
Available from dbt v1.9 or with [the dbt Cloud "Latest" release track](https://docs.getdbt.com/docs/dbt-versions/cloud-release-tracks) dbt Cloud.

Check warning on line 7 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#L7

[custom.Typos] Oops there's a typo -- did you really mean 'v1.9'?
Raw output
{"message": "[custom.Typos] Oops there's a typo -- did you really mean 'v1.9'? ", "location": {"path": "website/docs/reference/resource-properties/concurrent_batches.md", "range": {"start": {"line": 7, "column": 20}}}, "severity": "WARNING"}
runleonarun marked this conversation as resolved.
Show resolved Hide resolved

nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
<Tabs>
<TabItem value="Project file">


<File name='dbt_project.yml'>

```yaml
models:
+concurrent_batches: True
runleonarun marked this conversation as resolved.
Show resolved Hide resolved
```

</File>

</TabItem>


<TabItem value="sql file">

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

```sql
{{
config(
materialized='incremental',
concurrent_batches=True,
runleonarun marked this conversation as resolved.
Show resolved Hide resolved
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).
nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
runleonarun marked this conversation as resolved.
Show resolved Hide resolved

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

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 in your dbt_project.yml or model .sql file to specify parallel or sequential execution, given you meet all the conditions.

Check warning on line 53 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#L53

[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": 53, "column": 146}}}, "severity": "WARNING"}
runleonarun marked this conversation as resolved.
Show resolved Hide resolved

runleonarun marked this conversation as resolved.
Show resolved Hide resolved
If you've configured a microbatch incremental strategy and you're working with cumulative metrics or any logic that depends on batch order, you can override the default by setting concurrent_batches: false.

Check warning on line 55 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#L55

[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": 55, "column": 181}}}, "severity": "WARNING"}
runleonarun marked this conversation as resolved.
Show resolved Hide resolved

<File name='dbt_project.yml'>

nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
```yaml
models:
my_project:
cumulative_metrics_model:
+concurrent_batches: false
```
</File>


nataliefiann marked this conversation as resolved.
Show resolved Hide resolved
<File name='models/my_model.sql'>

```sql
{{
config(
materialized='incremental',
incremental_strategy='microbatch'
concurrent_batches=False
runleonarun marked this conversation as resolved.
Show resolved Hide resolved
)
}}
select ...

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

This ensures that batches are processed sequentially.
runleonarun marked this conversation as resolved.
Show resolved Hide resolved

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