fix(bamboohr): stop the field-history build running out of memory - #2506
Merged
aleksdotbar merged 1 commit intoAug 13, 2026
Merged
Conversation
) The employee field-level change log diffed two per-version maps and read both back after an ARRAY JOIN, so every key replicated the whole payload and a single block cost gigabytes. A build large enough to matter was stopped by the server memory tracker, failing the sync after extraction had already committed its records. Shape it as GROUP BY aggregation over a per-field timeline instead. Aggregation state spills to disk past max_bytes_before_external_group_by, which the previous form could not do at all — ARRAY JOIN and window sort state both stay resident. Peak memory now stays near flat as the snapshot grows rather than tracking its size. Output is unchanged, including the clear a field emits when a later version stops carrying it. No max_memory_usage on the model: a self-imposed cap converts a build the server could still afford into a hard failure. Closes #2491 Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 3fbbc02) Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
mitasovr
approved these changes
Aug 13, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backports #2495 to
release-2026.07.1.The employee field-level change log diffed two per-version maps and read both back after an
ARRAY JOIN, so every key replicated the wholeraw_datapayload and a single block cost gigabytes — the server memory tracker stopped the build, failing the sync after extraction had already committed. Reshaped as spillableGROUP BYaggregation over a per-field timeline; output unchanged.Cherry-picked clean from
3fbbc02— both files are byte-identical to upstream. The release branch already carried the pre-#2495fields_history.sqlvia the #2478 backport.fields_history()is shared by 10 connectors (zoom, slack, jira, youtrack, outline, ms-entra, workday, active-directory, cursor, zulip-proxy), so their builds change the same way they did onmain. Macro signature unchanged.Not run here: dbt parse/build.
Refs #2491.