-
Notifications
You must be signed in to change notification settings - Fork 381
Expand file tree
/
Copy pathschema.yml
More file actions
135 lines (130 loc) · 3.12 KB
/
schema.yml
File metadata and controls
135 lines (130 loc) · 3.12 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
version: 2
models:
- name: simple_model_a
description: A simple model for testing
columns:
- name: a
data_type: int
unit_tests:
- name: test_simple_model_a_outputs_one
description: Test that simple_model_a outputs 1 as column a
model: simple_model_a
given: [] # No input models needed
expect:
format: csv
rows: |
a
1
- name: simple_model_b
description: Model that references simple_model_a
columns:
- name: a
data_type: int
unit_tests:
- name: test_simple_model_b_with_mock_input
description: Test simple_model_b with mocked simple_model_a input
model: simple_model_b
given:
- input: ref('simple_model_a')
format: csv
rows: |
a
10
20
30
expect:
format: csv
rows: |
a
10
20
30
- name: test_simple_model_b_with_sql_input
description: Test simple_model_b with SQL-defined input data
model: simple_model_b
given:
- input: ref('simple_model_a')
format: sql
rows: SELECT 42 AS a
expect:
format: sql
rows: SELECT 42 AS a
- name: top_waiters
description: description of top waiters
columns:
- name: waiter_id
data_type: int
- name: revenue
data_type: double
- name: model_columns
data_type: int
freshness:
warn_after: {count: 6, period: hour}
error_after: {count: 7, period: hour}
config:
dialect: postgres
freshness:
warn_after: {count: 8, period: hour}
error_after: {count: 9, period: hour}
- name: waiters
description: '{{ doc("waiters") }}'
config:
# Exercise pre and post hooks
pre_hook:
- SELECT 1
post_hook:
- SELECT 1
- name: waiter_as_customer_by_day
- name: waiter_revenue_by_day
versions:
- v: 1
- v: 2
- name: disabled_model
columns:
- name: one
tests:
- not_null
sources:
- name: streaming
schema: raw
tables:
- name: items
config:
meta:
- name: orders
config:
meta:
- name: order_items
config:
meta:
freshness:
warn_after: {count: 10, period: hour}
error_after: {count: 11, period: hour}
config:
freshness:
warn_after: {count: 12, period: hour}
error_after: {count: 13, period: hour}
- name: parquet_file
meta:
external_location: "read_parquet('path/to/external/{name}.parquet')"
tables:
- name: items
- name: orders
semantic_models:
- name: top_waiters
description: Some description
model: ref('top_waiters')
measures:
- name: total_waiters
agg: sum
expr: waiter
dimensions:
- name: waiter
type: categorical
metrics:
- name: some_waiter_thing
description: Something
type: simple
label: testing
type_params:
measure: total_waiters