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

support MicrobatchConcurrency capability #1259

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Nov 27, 2024

resolves #1260
docs dbt-labs/docs.getdbt.com/#

Problem

dbt-snowflake does not yet support running the microbatch incremental strategy in concurrent threads.

Solution

  • Ensure temp tables are written to unique locations when batch.id is available (in microbatch model context)
  • Enable MicrobatchConcurrency capability

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@cla-bot cla-bot bot added the cla:yes label Nov 27, 2024
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-snowflake contributing guide.

Copy link
Contributor

@QMalcolm QMalcolm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Comment on lines +83 to +85

{% set tmp_relation_suffix = '__dbt_tmp' if not model.batch else '__dbt_tmp_' ~ model.batch.id %}
{% set tmp_relation = make_temp_relation(this, suffix=tmp_relation_suffix).incorporate(type=tmp_relation_type) %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is perfect and will continue to work after the planned dbt-adapters change!

@MichelleArk MichelleArk marked this pull request as ready for review December 2, 2024 14:53
@MichelleArk MichelleArk requested a review from a team as a code owner December 2, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable MicrobatchConcurrency for dbt-snowflake
2 participants