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 #330
Description
Adds a call to the macro process_schema_change after creating the temp relation and before merging. Similar to dbt-spark's incremental materialization.
It will allow the "ignore", "fail" and "append_new_columns" as on_schema_change strategy but not the "sync_all_columns" because the macro spark__alter_relation_add_remove_columns does not allow for dropping columns. It could because Delta allow for dropping columns if table properties are :
It will be possible once dbt-sprak PR #1088 is merged.
WARNING : there is still a limitation. For example, if using "ignore" strategy and removing columns, update will fail because spark__get_merge_sql uses update set * which looks for all columns.
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 :
I am not sure wether this change needs testing, if it does, I would be interested in understanding how to!
Tests that were run locally
Add a simple model with incremental strategy (test_change_schema) :
Run it a first time and add a new columns :
Column is added.