-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdbt_project.yml
110 lines (100 loc) · 3.8 KB
/
dbt_project.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: 'snowplow_web'
version: '0.5.0'
config-version: 2
require-dbt-version: [">=0.20.0", "<1.1.0"]
profile: 'default'
source-paths: ["models"]
test-paths: ["tests"]
macro-paths: ["macros"]
docs-paths: ["docs"]
asset-paths: ["assets"]
target-path: "target"
clean-targets:
- "target"
- "dbt_modules"
- "dbt_packages"
vars:
# Sources
# snowplow__atomic_schema: Only set if not using 'atomic' schema for Snowplow events data
# snowplow__database: Only set if not using target.database for Snowplow events data
snowplow__events: "{{ source('atomic','events') }}"
snowplow__page_view_context: "{{ source('atomic','com_snowplowanalytics_snowplow_web_page_1') }}"
snowplow__iab_context: "{{ source('atomic','com_iab_snowplow_spiders_and_robots_1') }}"
snowplow__ua_parser_context: "{{ source('atomic','com_snowplowanalytics_snowplow_ua_parser_context_1') }}"
snowplow__yauaa_context: "{{ source('atomic','nl_basjes_yauaa_context_1') }}"
snowplow__sessions_table: "{{ ref('snowplow_web_sessions') }}" # Change to your custom sessions table if you have disabled the standard sessions table in favour of a custom version. Advanced config.
# Variables - Standard Config
snowplow__start_date: '2020-01-01'
snowplow__min_visit_length: 5
snowplow__heartbeat: 10
snowplow__backfill_limit_days: 30
snowplow__app_id: []
# Setting default values for 3 enrichments below throughout package rather than here
# Workaround for a bug (https://github.com/dbt-labs/dbt-core/issues/3698).
# TODO: Return to having default values here once fixed.
# snowplow__enable_iab: false
# snowplow__enable_ua: false
# snowplow__enable_yauaa: false
snowplow__ua_bot_filter: true
snowplow__derived_tstamp_partitioned: true
snowplow__session_stitching: true
# Variables - Advanced Config
snowplow__lookback_window_hours: 6
snowplow__session_lookback_days: 365
snowplow__days_late_allowed: 3
snowplow__max_session_days: 3
snowplow__upsert_lookback_days: 30
snowplow__incremental_materialization: "snowplow_incremental"
snowplow__dev_target_name: 'dev'
snowplow__allow_refresh: false
# Completely or partially remove models from the manifest during run start.
on-run-start:
- "{{ snowplow_utils.snowplow_web_delete_from_manifest(var('models_to_remove',[])) }}"
# Update manifest table with last event consumed per sucessfully executed node/model
on-run-end:
- "{{ snowplow_utils.snowplow_incremental_post_hook('snowplow_web') }}"
# Tag 'snowplow_web_incremental' allows snowplow_incremental_post_hook to identify Snowplow models
# and add their last sucessfull collector_tstamp to the manifest.
models:
snowplow_web:
+materialized: view
+bind: false
base:
manifest:
+schema: "snowplow_manifest"
scratch:
+schema: "scratch"
+tags: "scratch"
bigquery:
enabled: "{{ target.type == 'bigquery' | as_bool() }}"
default:
enabled: "{{ target.type in ['redshift', 'postgres'] | as_bool() }}"
snowflake:
enabled: "{{ target.type == 'snowflake' | as_bool() }}"
page_views:
+schema: "derived"
+tags: "snowplow_web_incremental"
scratch:
+schema: "scratch"
+tags: "scratch"
bigquery:
enabled: "{{ target.type == 'bigquery' | as_bool() }}"
default:
enabled: "{{ target.type in ['redshift', 'postgres'] | as_bool() }}"
snowflake:
enabled: "{{ target.type == 'snowflake' | as_bool() }}"
sessions:
+schema: "derived"
+tags: "snowplow_web_incremental"
scratch:
+schema: "scratch"
+tags: "scratch"
user_mapping:
+schema: "derived"
+tags: "snowplow_web_incremental"
users:
+schema: "derived"
+tags: "snowplow_web_incremental"
scratch:
+schema: "scratch"
+tags: "scratch"