fix!: correctly use execution time on new rows for scd type 2 by column #3192
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.
This corrects the SCD Type 2 By Column default behavior to use execution time for new rows after the table is initially loaded. This matches what the documentation example says it should behave. This does mean there is a behavior change for current users but the current behavior seems to be a bug. There is not a way for a user to maintain old behavior if they wanted it since we consider it a bug.
From reviewing the code,
truncate
is a great way to identify if a table is being loaded for the first time. This also means that if a user issues a restatement on the table and wants to rebuild from scratch then it would also be set totruncate
and would mimic loading the rows for the first time.