-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdozer-config.yaml
46 lines (36 loc) · 1.12 KB
/
dozer-config.yaml
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
app_name: window-functions-sample
version: 1
connections:
- config : !LocalStorage
details:
path: ../data
tables:
- !Table
name: trips
config: !Parquet
path: trips
extension: .parquet
name: ny_taxi
sources:
- name: trips
table_name: trips
connection: ny_taxi
sql: |
-- get the total tips for each location in a 5 minute window
SELECT t.PULocationID as location, SUM(t.tips) AS total_tips, t.window_start as start, t.window_end AS end
INTO table1
FROM TUMBLE(trips, pickup_datetime, '5 MINUTES') t
GROUP BY t.PULocationID, t.window_start, t.window_end;
-- get the total tips for each location where every window of 5 minutes overlaps by 2 minutes
SELECT t.PULocationID as location, SUM(t.tips) AS total_tips, t.window_start as start, t.window_end AS end
INTO table2
FROM HOP(trips, pickup_datetime, '2 MINUTE', '5 MINUTES') t
GROUP BY t.PULocationID, t.window_start, t.window_end;
endpoints:
- name: tumble
path: /tumble
table_name: table1
- name: hop
path: /hop
table_name: table2
cache_max_map_size: 2147483648