aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/EquiJoin/EquiFullRightOnly3Str.yqls
blob: 97a13fa2b9e2f25eb3dcc18820dbc3091c5c7b3e (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
(
(let mr_source (DataSource 'yt 'plato))
(let x (Read! world mr_source (Key '('table (String 'Input1))) '('key 'subkey 'value) '()))
(let world (Left! x))
(let table1 (Right! x))

(let x (Read! world mr_source (Key '('table (String 'Input2))) '('key 'subkey 'value) '()))
(let world (Left! x))
(let table2 (Right! x))

(let x (Read! world mr_source (Key '('table (String 'Input3))) '('key 'subkey 'value) '()))
(let world (Left! x))
(let table3 (Right! x))

(let join (EquiJoin '(table1 'a) '(table2 'b) '(table3 'c) 
  '('Full
    '('RightOnly '"a" '"b" '('"a" '"key") '('"b" '"key" ) '()) 
    '"c" '('"b" '"key") '('"c" '"key") '()) '()))
(let res_sink (DataSink 'result))
(let sortDir '((Bool 'true) (Bool 'true) (Bool 'true) (Bool 'true)))
(let keySelector (lambda '(row) '((Member row '"b.key") (Member row '"b.subkey") (Member row '"c.key") (Member row '"c.subkey"))))
(let world (Write! world res_sink (Key) (Sort join sortDir keySelector) '('('type))))
(let world (Commit! world res_sink))
(return world)
)