Adding missing 1.9 Snapshot behavior #904
Merged
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 #901 #902
Description
Apparently a late addition to the 1.9 (or at least late for adapter implementors to find out about) was a bunch of new snapshot behavior. Unfortunately the validation tests were not at all aligned with Databricks limitations, so had to bring in a bunch of code and tailor it, rather than just import the tests like we do ideally. This should allow the list of unique column behavior and the hard delete strategy. Note: most of the materialization is lifted as is from dbt-adapters default implementation, but keeping some Databricks specializations (like having to apply check constraints later). This materialization will be getting a face lift in 1.10.x, along with the other materializations, so I wanted to minimize the special effort required now.
TL;DR, the test code is quite ugly because it is copy-pasta and I'm trying to unblock this behavior quickly.
Checklist
CHANGELOG.md
and added information about my change to the "dbt-databricks next" section.