blob: eaa0d95edbd55656bd58e2bb5b4dda9cc801e5d1 (
plain) (
blame)
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
(
(let world (block '(
(let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"hits"))) (Void) '()))
(let world (Left! x))
(let table0 (Right! x))
(let values (block '(
(let select (block '(
(let core (block '(
(let select (block '(
(let core (EquiJoin '((block '(
(let select (block '(
(let core table0)
(let core (block '(
(return (Aggregate core '('"url") '()))
)))
(let core (FlatMap core (lambda '(row) (block '(
(let res (Struct))
(let res (AddMember res '"Url" (Member row '"url")))
(let res (AddMember res '"Date" (String '"2016-10-25")))
(let res (AsList res))
(return res)
)))))
(return core)
)))
(return select)
)) '"target") '(table0 '"history") '('Inner '"target" '"history" '('"target" '"Url") '('"history" '"url") '()) '()))
(let core (FlatMap core (lambda '(row) (block '(
(let res (Struct))
(let res (SelectMembers row '('"history.")))
(let res (AddMember res '"Url" (Member row '"target.Url")))
(let res (AddMember res '"Date" (Member row '"target.Date")))
(let res (AsList res))
(return res)
)))))
(return core)
)))
(return select)
)))
(let core (FlatMap core (lambda '(row) (block '(
(let res (AsList row))
(return res)
)))))
(return core)
)))
(return select)
)))
(let world (block '(
(let sink (DataSink '"yt" '"plato"))
(let world (Write! world sink (Key '('table (String '"out1"))) values '('('mode 'renew))))
(return world)
)))
(return world)
)))
(let world (block '(
(let hahn_sink (DataSink '"yt" '"plato"))
(let world (Commit! world hahn_sink))
(return world)
)))
(let world (block '(
(let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"out1"))) '('"Url" '"Date") '()))
(let world (Left! x))
(let table3 (Right! x))
(let x (Read! world (DataSource '"yt" '"plato") (Key '('table (String '"hits"))) '('"url") '()))
(let world (Left! x))
(let table0 (Right! x))
(let values (block '(
(let select (block '(
(let core (Map (EquiJoin '((Map (block '(
(let select (block '(
(let core table3)
(let core (block '(
(return (Aggregate core '('"Date" '"Url") '()))
)))
(let core (FlatMap core (lambda '(row) (block '(
(let res (Struct))
(let res (AddMember res '"Url" (Member row '"Url")))
(let res (AddMember res '"Date" (Member row '"Date")))
(let res (AddMember res '"Host" ("Apply" ("Udf" '"Url.GetHost") (Member row '"Url"))))
(let res (AsList res))
(return res)
)))))
(return core)
)))
(return select)
)) (lambda '(row) (block '(
(let row (AddMember row '"_equijoin_column_0" ("Apply" ("Udf" '"Url.GetHost") (Member row '"Url"))))
(return row)
)))) '"pool") '((block '(
(let select (block '(
(let core (Map (EquiJoin '((block '(
(let select (block '(
(let core (block '(
(let select (block '(
(let core table3)
(let core (block '(
(return (Aggregate core '('"Date" '"Url") '()))
)))
(let core (FlatMap core (lambda '(row) (block '(
(let res (Struct))
(let res (AddMember res '"Url" (Member row '"Url")))
(let res (AddMember res '"Date" (Member row '"Date")))
(let res (AddMember res '"Host" ("Apply" ("Udf" '"Url.GetHost") (Member row '"Url"))))
(let res (AsList res))
(return res)
)))))
(return core)
)))
(return select)
)))
(let core (block '(
(return (Aggregate core '('"Host") '()))
)))
(let core (FlatMap core (lambda '(row) (block '(
(let res (Struct))
(let res (AddMember res '"Host" (Member row '"Host")))
(let res (AddMember res '"Date" (String '"2016-10-25")))
(let res (AsList res))
(return res)
)))))
(return core)
)))
(return select)
)) '"hosts") '((Map table0 (lambda '(row) (block '(
(let row (AddMember row '"_equijoin_column_0" ("Apply" ("Udf" '"Url.GetHost") (Member row '"url"))))
(return row)
)))) '"all_hits") '('Left '"hosts" '"all_hits" '('"hosts" '"Host") '('"all_hits" '"_equijoin_column_0") '()) '()) (lambda '(row) (block '(
(let row (ForceRemoveMember row '"all_hits._equijoin_column_0"))
(return row)
)))))
(let core (block '(
(let Count4_create (lambda '(row) (Uint64 '1)))
(let Count4_update (lambda '(row state) (OptionalReduce state (Uint64 '1) (lambda '(a b) (+ a b)))))
(let Count4_save (lambda '(state) state))
(let Count4_load (lambda '(item) item))
(let Count4_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
(let Count4_finish (lambda '(state) state))
(let Count5_create (lambda '(row) (Convert (Exists row) 'Uint64)))
(let Count5_update (lambda '(row state) (OptionalReduce state (Convert (Exists row) 'Uint64) (lambda '(a b) (+ a b)))))
(let Count5_save (lambda '(state) state))
(let Count5_load (lambda '(item) item))
(let Count5_merge (lambda '(a b) (OptionalReduce a b (lambda '(a b) (+ a b)))))
(let Count5_finish (lambda '(state) state))
(return (Aggregate core '('"hosts.Date" '"hosts.Host") '('('Count4 (AggregationTraits (ListItemType (TypeOf core)) Count4_create Count4_update Count4_save Count4_load Count4_merge Count4_finish (Uint64 '0))) '('Count5 (AggregationTraits (StructMemberType (ListItemType (TypeOf core)) '"all_hits.url") Count5_create Count5_update Count5_save Count5_load Count5_merge Count5_finish (Uint64 '0)) '"all_hits.url"))))
)))
(let core (FlatMap core (lambda '(row) (block '(
(let res (Struct))
(let res (AddMember res '"Host" (Member row '"hosts.Host")))
(let res (AddMember res '"Date" (Member row '"hosts.Date")))
(let res (AddMember res '"url_day_count" (Member row 'Count4)))
(let res (AddMember res '"url_count" (Member row 'Count5)))
(let res (AsList res))
(return res)
)))))
(return core)
)))
(return select)
)) '"host") '('Left '"pool" '"host" '('"pool" '"_equijoin_column_0" '"pool" '"Date") '('"host" '"Host" '"host" '"Date") '()) '()) (lambda '(row) (block '(
(let row (ForceRemoveMember row '"pool._equijoin_column_0"))
(return row)
)))))
(let core (FlatMap core (lambda '(row) (block '(
(let res (AsList row))
(return res)
)))))
(return core)
)))
(return select)
)))
(let world (block '(
(let sink (DataSink '"yt" '"plato"))
(let world (Write! world sink (Key '('table (String '"out2"))) values '('('mode 'renew))))
(return world)
)))
(return world)
)))
(let world (block '(
(let hahn_sink (DataSink '"yt" '"plato"))
(let world (Commit! world hahn_sink))
(return world)
)))
(let world (block '(
(let sink (DataSink '"yt" '"plato"))
(let world (Write! world sink (Key '('table (String '"out1"))) (Void) '('('mode 'drop))))
(return world)
)))
(let world (block '(
(let hahn_sink (DataSink '"yt" '"plato"))
(let world (Commit! world hahn_sink))
(return world)
)))
(return world)
)
|