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

Append model.batch.id to suffix in make_temp_relation when present #361

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

QMalcolm
Copy link
Contributor

@QMalcolm QMalcolm commented Nov 20, 2024

resolves #360

Problem

Batches for a microbatch model were all getting the same temp relation name. This is fine if batches are running sequentially. However, we're enabling concurrent batch execution support. In which case, if the batches have the same temp relation name, they may clobber each other and result in "bad things"™️

Solution

Append the model.batch.id to the suffix of the temporary relation name when present

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 The PR author has signed the CLA label Nov 20, 2024
@QMalcolm QMalcolm added the Skip Changelog Skip changelog verification in a PR label Nov 20, 2024
@dbt-labs dbt-labs deleted a comment from github-actions bot Nov 20, 2024
@QMalcolm QMalcolm changed the title Append __dbt_internal_event_time_start to suffix in make_temp_relation when present (WIP) Append model.batch.id to suffix in make_temp_relation when present Dec 3, 2024
@QMalcolm QMalcolm force-pushed the qmalcolm--microbatch-temp-table-naming branch from 85a203b to ab40b89 Compare December 4, 2024 17:01
@QMalcolm QMalcolm changed the title (WIP) Append model.batch.id to suffix in make_temp_relation when present Append model.batch.id to suffix in make_temp_relation when present Dec 4, 2024
@QMalcolm QMalcolm marked this pull request as ready for review December 4, 2024 17:07
@QMalcolm QMalcolm requested a review from a team as a code owner December 4, 2024 17:07
@QMalcolm QMalcolm merged commit 86efa88 into main Dec 4, 2024
10 checks passed
@QMalcolm QMalcolm deleted the qmalcolm--microbatch-temp-table-naming branch December 4, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes The PR author has signed the CLA Skip Changelog Skip changelog verification in a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Microbatch] Update default make_temp_relation macro to incorporate a batch specific identifier if available
3 participants