-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null-safe equality for unique_key
within delete+insert
and merge
incremental strategies
#110
base: main
Are you sure you want to change the base?
Null-safe equality for unique_key
within delete+insert
and merge
incremental strategies
#110
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
I appologies that reach you directly but is there news for this PR? If there is additional help or actions required? Could you please tell me wether help is needed and if I can I willl try to help. This PR fixed the issue that is really annoying :( Thanks in advance! |
First of all many thanks for such usefull PR! You provided changes for Could you please add Thanks in advance! |
unique_key
within delete+insert
incremental strategy
unique_key
within delete+insert
incremental strategyunique_key
within delete+insert
and merge
incremental strategies
@colin-rogers-dbt, I Reviewed this and thought about it with @dbeatty10 a bit. We think it looks good. |
@peterallenwebb and I took a closer look at this today, and we think there's a couple more test cases to add:
I will take responsibility for trying out these cases and adding these tests. |
Important After decoupling dbt-adapters from dbt-core, only the unit tests run in CI; none of the functional tests run in CI in this repo. So we'll need to run the changes in this PR along within the functional tests in dbt-postgres (and possibly also dbt-snowflake, dbt-bigquery, and dbt-redshift) in order to know that the changes work as intended. |
Can't wait this feature! |
Null-safe equality for
unique_key
withindelete+insert
andmerge
incremental strategies with an appropriate null comparison.resolves #159
Problem
The current implementation of the incremental merge does not use null-safe equality, meaning if any of the columns are null, duplicate values will be inserted every time the model is run. This is unlikely to be desired behaviour for anyone.
Solution
The SQL for the delete condition is updated to handle a check for null values.
Checklist