Fix table materialization for Delta models #420
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 #419 with the first (maybe not the best) idea
Description
I modified the function get_relation to pass the argument is_delta to the relation's creation.
Then, I added a "or replace" in the glue__create_table_as to be able to rebuild multiple times the same model.
I am pretty sure we could update the is_iceberg and is_hudi arguments in the same way hence render the iceberg_table_replace useless but I did not have time to test it out
Checklist
CHANGELOG.md
and added information about my change to the "dbt-glue next" section.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
FYI :
Tests that were run locally
Simple model with minimal table strategy (test_table):
No problem at first run but when running a second time the following command :
Got the following error :
Now I can rebuild the model without problem, change its schema also works.