-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Created concurrent batches page #6601
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
Merged
Merged
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 db35f09
Merge branch 'nfiann-rbip' into new-branch-name
mirnawong1 9dba8c4
Merge branch 'nfiann-rbip' into new-branch-name
mirnawong1 3cc8a37
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann d291fab
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 14f61ec
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann e2cc0b2
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 9002879
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann d023f84
Merge branch 'nfiann-rbip' into new-branch-name
mirnawong1 1fb7062
Update incremental-microbatch.md
mirnawong1 ff9ae29
Merge branch 'nfiann-rbip' into new-branch-name
mirnawong1 4bf5637
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 00fb5ee
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 9048883
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 784adfc
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 4a0557b
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 0872a61
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann f6c63cb
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 4082870
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 96739ec
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 904df2b
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 13c01af
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 0be33fd
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 08b0bdb
Update website/docs/reference/resource-properties/concurrent_batches.md
nataliefiann 8cdd951
Merge branch 'nfiann-rbip' into new-branch-name
nataliefiann dbee07f
Updated doc
nataliefiann d8f9529
Merge branch 'new-branch-name' of https://github.com/dbt-labs/docs.ge…
nataliefiann 8d75934
Updated doc with closing tags
nataliefiann a878e1c
Apply suggestions from code review
runleonarun 0a3ac40
Apply suggestions from code review
runleonarun e27c337
Apply suggestions from code review
runleonarun 9de3005
Merge branch 'nfiann-rbip' into new-branch-name
runleonarun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
90 changes: 90 additions & 0 deletions
90
website/docs/reference/resource-properties/concurrent_batches.md
This file contains hidden or 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,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
|
||
:::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> | ||
|
||
|
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.