Skip to content

Commit 3dc0657

Browse files
authored
indirect forward-only changes: don't always categorize as breaking
1 parent 6609057 commit 3dc0657

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sqlmesh/core/plan/builder.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,9 +674,11 @@ def _categorize_snapshot(
674674
if mode == AutoCategorizationMode.FULL:
675675
snapshot.categorize_as(SnapshotChangeCategory.BREAKING, forward_only)
676676
elif self._context_diff.indirectly_modified(snapshot.name):
677-
if snapshot.is_materialized_view:
677+
if snapshot.is_materialized_view and not forward_only:
678678
# We categorize changes as breaking to allow for instantaneous switches in a virtual layer.
679679
# Otherwise, there might be a potentially long downtime during MVs recreation.
680+
# In the case of forward-only changes this optimization is not applicable because we continue using the
681+
# same (existing) table version.
680682
snapshot.categorize_as(SnapshotChangeCategory.INDIRECT_BREAKING, forward_only)
681683
return
682684

0 commit comments

Comments
 (0)