aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/Aggregation/AggrCount.yql
blob: f0a27ab8d5882ddc8e14e49b7ed5f696aaf33613 (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
(
#comment
(let config (DataSource 'config))
(let world (Configure! world config 'PureDataSource 'yt))

(let res_sink (DataSink 'result))
(let x (Int32 '34))
(let jx (Just x))
(let n (Nothing (TypeOf jx)))

(let world (Write! world res_sink (Key) (AggrCountInit x) '('('type))))
(let world (Write! world res_sink (Key) (AggrCountInit jx) '('('type))))
(let world (Write! world res_sink (Key) (AggrCountInit n) '('('type))))

(let world (Write! world res_sink (Key) (AggrCountUpdate x (Uint64 '10)) '('('type))))
(let world (Write! world res_sink (Key) (AggrCountUpdate jx (Uint64 '10)) '('('type))))
(let world (Write! world res_sink (Key) (AggrCountUpdate n (Uint64 '10)) '('('type))))

(let cx (Callable (ParseType '"()->Int32") (lambda '() x)))
(let cjx (Callable (ParseType '"()->Int32?") (lambda '() jx)))
(let cn (Callable (ParseType '"()->Int32?") (lambda '() n)))

(let world (Write! world res_sink (Key) (AggrCountInit (Apply cx)) '('('type))))
(let world (Write! world res_sink (Key) (AggrCountInit (Apply cjx)) '('('type))))
(let world (Write! world res_sink (Key) (AggrCountInit (Apply cn)) '('('type))))

(let world (Write! world res_sink (Key) (AggrCountUpdate (Apply cx) (Uint64 '10)) '('('type))))
(let world (Write! world res_sink (Key) (AggrCountUpdate (Apply cjx) (Uint64 '10)) '('('type))))
(let world (Write! world res_sink (Key) (AggrCountUpdate (Apply cn) (Uint64 '10)) '('('type))))

(let world (Commit! world res_sink))
(return world)
)