forked from SQLMesh/sqlmesh
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.yml
More file actions
84 lines (83 loc) · 2.05 KB
/
schema.yml
File metadata and controls
84 lines (83 loc) · 2.05 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
version: 2
models:
- name: customers
columns:
- name: customer_id
description: Customer id
tests:
- not_null
- name: customer_revenue_by_day
columns:
- name: customer_id
description: Customer id
tests:
- not_null
- relationships:
to: ref('customers')
field: customer_id
- name: revenue
description: Revenue from orders made by this customer
tests:
- less_than_amount:
amount: 1000
- greater_than_amount:
amount: 0
- name: ds
description: Date
- name: top_waiters
columns:
- name: waiter_id
description: Waiter id
tests:
- not_null
- relationships:
to: ref('waiters')
field: waiter_id
- name: revenue
description: Revenue from orders served by this waiter
- name: unused_column
data_type: int
- name: waiters
columns:
- name: waiter_id
description: Waiter id
- name: ds
description: Date
- name: waiter_as_customer_by_day
columns:
- name: ds
description: Date
- name: waiter_id
description: Waiter id
tests:
- not_null:
config:
where: "waiter_id > 1"
- relationships:
to: ref('waiters')
field: waiter_id
- name: waiter_name
description: The name of the waiter
tests:
- relationships:
to: ref('waiter_names')
field: name
- name: waiter_revenue_by_day
columns:
- name: waiter_id
description: Waiter id
tests:
- not_null
- relationships:
to: ref('waiters')
field: waiter_id
- name: revenue
description: Revenue from orders taken by this waiter
tests:
- less_than_amount:
amount: 10000
- name: ds
description: Date
versions:
- v: 1
- v: 2