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

(let res_sink (DataSink 'result))
(let list1 (AsList
    (AsStruct '('a (Uint32 '4)) '('b (String 'c)))
    (AsStruct '('a (Uint32 '1)) '('b (String 'd)))
    (AsStruct '('a (Uint32 '3)) '('b (String 'b)))
))
(let list2 (AsList
    (AsStruct '('a (Uint32 '2)) '('b (String 'a)))
    (AsStruct '('a (Uint32 '5)) '('b (String 'y)))
    (AsStruct '('a (Uint32 '1)) '('b (String 'z)))
))
(let world (Write! world res_sink (Key)
    (Merge
        list1
        list2
    )
'('('type))))

(let world (Write! world res_sink (Key)
    (Merge
        (Sort list1 (Bool 'True) (lambda '(item) (Member item 'a)))
        (Sort list2 (Bool 'True) (lambda '(item) (Member item 'a)))
    )
'('('type))))

(let world (Write! world res_sink (Key)
    (Merge
        (Sort list1 (Bool 'False) (lambda '(item) (Member item 'a)))
        (Sort list2 (Bool 'False) (lambda '(item) (Member item 'a)))
    )
'('('type))))

(let world (Write! world res_sink (Key)
    (Merge
        (Sort list1 '((Bool 'True) (Bool 'True)) (lambda '(item) '((Member item 'a) (Member item 'b))))
        (Sort list2 '((Bool 'True) (Bool 'True)) (lambda '(item) '((Member item 'a) (Member item 'b))))
    )
'('('type))))

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