aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/Lib/Agg_Bit_And.yql
blob: 75cbff27311de3f163ddd14087066541576d6ad5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# program
(
(let config (DataSource 'config))
(let world (Configure! world config 'PureDataSource 'yt))

(import agg_module '"/lib/yql/aggregate.yql")
(let list (AsList
(AsStruct '('key (Uint32 '1)) '('value (Uint32 '1)))
(AsStruct '('key (Uint32 '2)) '('value (Uint32 '3)))
(AsStruct '('key (Uint32 '1)) '('value (Uint32 '4)))
(AsStruct '('key (Uint32 '3)) '('value (Uint32 '9)))
(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
(AsStruct '('key (Uint32 '2)) '('value (Uint32 '5)))
))
(let and_traits (Apply (bind agg_module 'bit_and_traits_factory) (TypeOf list) (lambda '(row) (Member row 'value))))
(let res_sink (DataSink 'result))
(let resKey (Aggregate list '('key) '('('and_value and_traits))))
(let world (Write! world res_sink (Key) resKey '('('type))))
(let world (Commit! world res_sink))
(return world)
)