Skip to content

Commit

Permalink
Merge pull request #16 from fishtown-analytics/feature/upgrade-to-dbt…
Browse files Browse the repository at this point in the history
…-090

namespaced all already_exists calls
  • Loading branch information
jthandy authored Aug 7, 2017
2 parents a280b73 + 5554279 commit 11f6f96
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion models/identification/snowplow_id_map.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ new_events as (
select *
from all_events

{% if already_exists(this.schema, this.name) and not flags.FULL_REFRESH %}
{% if adapter.already_exists(this.schema, this.name) and not flags.FULL_REFRESH %}
where collector_tstamp > (
select coalesce(max(max_tstamp), '0001-01-01') from {{ this }}
)
Expand Down
2 changes: 1 addition & 1 deletion models/page_views/snowplow_page_views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ with all_events as (
web_events as (

select * from all_events
{% if already_exists(this.schema, this.name) and not flags.FULL_REFRESH %}
{% if adapter.already_exists(this.schema, this.name) and not flags.FULL_REFRESH %}
where collector_tstamp > (
select coalesce(max(max_tstamp), '0001-01-01') from {{ this }}
)
Expand Down
3 changes: 1 addition & 2 deletions models/page_views/snowplow_web_events.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ with all_events as (
events as (

select * from all_events
{% if already_exists(this.schema, this.name) and not flags.FULL_REFRESH %}
{% if adapter.already_exists(this.schema, this.name) and not flags.FULL_REFRESH %}
where collector_tstamp > (
select coalesce(max(collector_tstamp), '0001-01-01') from {{ this }}
)
Expand Down Expand Up @@ -134,4 +134,3 @@ dedupe as (
)

select * from dedupe where n = 1

2 changes: 1 addition & 1 deletion models/page_views/snowplow_web_events_scroll_depth.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}}

{# cache this because we need it below too #}
{% set this_exists = already_exists(this.schema, this.name) and not flags.FULL_REFRESH%}
{% set this_exists = adapter.already_exists(this.schema, this.name) and not flags.FULL_REFRESH%}

with all_events as (

Expand Down
2 changes: 1 addition & 1 deletion models/page_views/snowplow_web_events_time.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}}

{# cache this because we need it below too #}
{% set this_exists = already_exists(this.schema, this.name) and not flags.FULL_REFRESH%}
{% set this_exists = adapter.already_exists(this.schema, this.name) and not flags.FULL_REFRESH%}

with all_events as (

Expand Down

0 comments on commit 11f6f96

Please sign in to comment.