Skip to content

Commit

Permalink
Merge pull request #1293 from fishtown-analytics/fix/incremental-from…
Browse files Browse the repository at this point in the history
…-view

Fix for models which transition from views to incremental
  • Loading branch information
drewbanin committed Feb 13, 2019
2 parents 026c50d + 2847f69 commit cf873d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
{{ return(False) }}
{% else %}
{% set relation = adapter.get_relation(this.database, this.schema, this.table) %}
{{ return(relation is not none and not flags.FULL_REFRESH) }}
{{ return(relation is not none and relation.type == 'table' and not flags.FULL_REFRESH) }}
{% endif %}
{% endmacro %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
{{ config(materialized=var('materialized')) }}

select '{{ var("materialized") }}' as materialization

{% if var('materialized') == 'incremental' and is_incremental() %}
where 'abc' != (select max(materialization) from {{ this }})
{% endif %}

0 comments on commit cf873d0

Please sign in to comment.