fix: handle shallow clones in dbt clone, table, and incremental rebuilds - #1592
Merged
Conversation
saishreeeee
marked this pull request as ready for review
July 17, 2026 04:42
sd-db
reviewed
Jul 17, 2026
|
@sd-db do you know when this fix will be released? |
Collaborator
|
@lgpreston75 hopefully this coming monday |
sd-db
added a commit
that referenced
this pull request
Aug 9, 2026
Resolves a conflict in `table.sql` between this branch's `replaced_in_place` refactor and #1592, which added `is_shallow_clone` to the two drop conditions that `replaced_in_place` negates. Since a shallow clone's table type cannot be changed in place, it must be dropped and recreated -- so it is not replaced in place and inherits no tags. Folded the term into the predicate rather than into the drop sites, keeping both as `not replaced_in_place`: replaced_in_place = existing_relation and not existing_relation.is_shallow_clone and existing_relation.type == 'table' and existing_relation.can_be_replaced and adapter.resolve_file_format(config) in ('delta', 'iceberg') `can_be_replaced` alone does not cover this: it tests relation type plus delta/iceberg provider, so a shallow clone of a delta table passes it. Add `TestRebuildOverShallowCloneAppliesAllTags`, which covers the interaction both changes touch: rebuilding a tagged table over a shallow clone must drop the clone and apply all tags to the fresh table. Without the `is_shallow_clone` term it fails on `MANAGED_SHALLOW_CLONE != MANAGED` -- i.e. it guards #1592's fix, not only the tag diff. Also move this branch's changelog entry to the 1.12.4 (TBD) section; the automatic merge placed it under the already-released 1.12.2 heading.
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.
Resolves #1165
Description
Shallow clones have a distinct table_type that can't be changed in place, so
dbt cloneand table/incremental rebuilds over a clone failed (UPDATE_TABLE_TYPE,CLUSTER_BY_AUTO_UNSUPPORTED_TABLE_TYPE_ERROR).Adds
is_shallow_clone, drops the clone before recreating it (clone/table/incremental), and skipsCLUSTER BY AUTOwhen altering a clone in place.Checklist
CHANGELOG.mdand added information about my change to the "dbt-databricks next" section./dbt-databricks-pr-ready(AI agent skill in.claude/skills/) and addressed its merge-readiness feedback