-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply "Initial refactoring of incremental materialization" (#148)
### Description Applies "Initial refactoring of incremental materialization" (dbt-labs/dbt-core#5359). Now it uses `adapter.get_incremental_strategy_macro` instead of dbt-spark's `dbt_spark_get_incremental_sql` macro to dispatch the incremental strategy macro. The overwritten `dbt_spark_get_incremental_sql` macro will not work anymore. Co-authored-by: allisonwang-db <[email protected]>
- Loading branch information
1 parent
44ec7d9
commit 74e5ce2
Showing
4 changed files
with
30 additions
and
6 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
15 changes: 15 additions & 0 deletions
15
dbt/include/databricks/macros/materializations/incremental/strategies.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,15 @@ | ||
{% macro databricks__get_incremental_default_sql(arg_dict) %} | ||
{{ return(get_incremental_merge_sql(arg_dict)) }} | ||
{% endmacro %} | ||
|
||
{% macro databricks__get_incremental_append_sql(arg_dict) %} | ||
{% do return(get_insert_into_sql(arg_dict["temp_relation"], arg_dict["target_relation"])) %} | ||
{% endmacro %} | ||
|
||
{% macro databricks__get_incremental_merge_sql(arg_dict) %} | ||
{% do return(get_merge_sql(arg_dict["target_relation"], arg_dict["temp_relation"], arg_dict["unique_key"], dest_columns=none, predicates=none)) %} | ||
{% endmacro %} | ||
|
||
{% macro databricks__get_incremental_insert_overwrite_sql(arg_dict) %} | ||
{% do return(get_insert_overwrite_sql(arg_dict["temp_relation"], arg_dict["target_relation"])) %} | ||
{% endmacro %} |