Fix: Recreate views even if the change was categorized as indirect non-breaking to update table references #4414
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.
If I have model A and a downstream view model B, and I make a
Non-Breakingchange to A, then B is categorized asIndirect Non-Breaking. In this case, A gets a new physical table assigned to it, while B continues using the previous physical table by design.This is generally an acceptable strategy when the physical tables represent materialized tables, but it presents a problem if B's physical table represents a view - in that case, the model query itself is part of the physical table definition and needs to be updated.
If not updated, the view will continue referencing the old physical table of A. This means that when querying B, the user will either get outdated data or encounter a query failure if the old snapshot is deleted by the janitor.
This update ensures that views are always recreated for
Indirect Non-Breakingsnapshots when they are deployed to production.