-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1129 from fishtown-analytics/feature/better-incre…
…mental-models (fixes #744) deprecate sql_where and provide an alternative
- Loading branch information
Showing
9 changed files
with
72 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
{% macro is_incremental() %} | ||
{#-- do not run introspective queries in parsing #} | ||
{% if not execute %} | ||
{{ return(False) }} | ||
{% else %} | ||
{% set relation = adapter.get_relation(this.schema, this.table) %} | ||
{{ return(relation is not none and not flags.FULL_REFRESH) }} | ||
{% endif %} | ||
{% endmacro %} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
ProfileConfigDocs = 'https://docs.getdbt.com/docs/configure-your-profile' | ||
SnowflakeQuotingDocs = 'https://docs.getdbt.com/v0.10/docs/configuring-quoting' | ||
IncrementalDocs = 'https://docs.getdbt.com/docs/configuring-incremental-models' |
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
{{ | ||
config( | ||
materialized = "incremental", | ||
sql_where = "id>(select max(id) from {{this}})" | ||
materialized = "incremental" | ||
) | ||
}} | ||
|
||
select * from {{ ref('seed') }} | ||
|
||
{% if is_incremental() %} | ||
where id > (select max(id) from {{this}}) | ||
{% endif %} |
8 changes: 8 additions & 0 deletions
8
test/integration/001_simple_copy_test/models/incremental_deprecated.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,8 @@ | ||
{{ | ||
config( | ||
materialized = "incremental", | ||
sql_where = "id>(select max(id) from {{this}})" | ||
) | ||
}} | ||
|
||
select * from {{ ref('seed') }} |
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