-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
test/custom/incremental_strategies/data/expected_partial_upsert.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id,msg,color | ||
1,hello,blue | ||
2,yo,red | ||
3,anyway,purple |
22 changes: 22 additions & 0 deletions
22
test/custom/incremental_strategies/models_delta/merge_update_columns.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{{ config( | ||
materialized = 'incremental', | ||
incremental_strategy = 'merge', | ||
file_format = 'delta', | ||
unique_key = 'id', | ||
merge_update_columns = ['msg'], | ||
) }} | ||
|
||
{% if not is_incremental() %} | ||
|
||
select cast(1 as bigint) as id, 'hello' as msg, 'blue' as color | ||
union all | ||
select cast(2 as bigint) as id, 'goodbye' as msg, 'red' as color | ||
|
||
{% else %} | ||
|
||
-- msg will be updated, color will be ignored | ||
select cast(2 as bigint) as id, 'yo' as msg, 'green' as color | ||
union all | ||
select cast(3 as bigint) as id, 'anyway' as msg, 'purple' as color | ||
|
||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters