-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release/snowplow normalize/0.3.3 (#37)
- Loading branch information
Showing
12 changed files
with
59 additions
and
118 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
File renamed without changes.
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
36 changes: 0 additions & 36 deletions
36
models/base/scratch/bigquery/snowplow_normalize_base_events_this_run.sql
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
models/base/scratch/databricks/snowplow_normalize_base_events_this_run.sql
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
models/base/scratch/snowflake/snowplow_normalize_base_events_this_run.sql
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
models/base/scratch/snowplow_normalize_base_events_this_run.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,30 @@ | ||
{{ | ||
config( | ||
tags=["this_run"], | ||
sql_header=snowplow_utils.set_query_tag(var('snowplow__query_tag', 'snowplow_dbt')) | ||
) | ||
}} | ||
|
||
{%- set lower_limit, upper_limit, session_start_limit = snowplow_utils.return_base_new_event_limits(ref('snowplow_normalize_base_new_event_limits')) %} | ||
|
||
select | ||
a.* | ||
|
||
from {{ var('snowplow__events') }} as a | ||
|
||
where | ||
{# dvce_sent_tstamp is an optional field and not all trackers/webhooks populate it, this means this filter needs to be optional #} | ||
{% if var("snowplow__days_late_allowed") == -1 %} | ||
1 = 1 | ||
{% else %} | ||
a.dvce_sent_tstamp <= {{ snowplow_utils.timestamp_add('day', var("snowplow__days_late_allowed", 3), 'a.dvce_created_tstamp') }} | ||
{% endif %} | ||
and a.{{ var('snowplow__session_timestamp', 'collector_tstamp') }} >= {{ lower_limit }} | ||
and a.{{ var('snowplow__session_timestamp', 'collector_tstamp') }} <= {{ upper_limit }} | ||
{% if var('snowplow__derived_tstamp_partitioned', true) and target.type == 'bigquery' | as_bool() %} | ||
and a.derived_tstamp >= {{ snowplow_utils.timestamp_add('hour', -1, lower_limit) }} | ||
and a.derived_tstamp <= {{ upper_limit }} | ||
{% endif %} | ||
and {{ snowplow_utils.app_id_filter(var("snowplow__app_id",[])) }} | ||
|
||
qualify row_number() over (partition by a.event_id order by a.collector_tstamp{% if target.type in ['databricks', 'spark'] -%}, a.etl_tstamp {%- endif %}) = 1 |
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,3 +1,3 @@ | ||
packages: | ||
- package: snowplow/snowplow_utils | ||
version: [">=0.14.0", "<0.16.0"] | ||
version: [">=0.15.1", "<0.16.0"] |