aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/EquiJoin/JoinInMemRename.yql
blob: 14636284d28f972fe6874340e0526f80eb8184ff (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
(
(let config (DataSource 'config))
(let world (Configure! world config 'PureDataSource 'yt))

(let list1 (AsList 
  (AsStruct '('key1 (Int32 '1)) '('value1 (String 'A))) 
  (AsStruct '('key1 (Int32 '7)) '('value1 (String 'B)))
  (AsStruct '('key1 (Int32 '4)) '('value1 (String 'C)))
  (AsStruct '('key1 (Int32 '4)) '('value1 (String 'D)))
))

(let list2 (AsList 
  (AsStruct '('key2 (Int32 '9)) '('value2 (String 'Z))) 
  (AsStruct '('key2 (Int32 '4)) '('value2 (String 'Y))) 
  (AsStruct '('key2 (Int32 '3)) '('value2 (String 'X))) 
  (AsStruct '('key2 (Int32 '4)) '('value2 (String 'W)))
  (AsStruct '('key2 (Int32 '8)) '('value2 (String 'V)))
))

(let joinInner (EquiJoin '(list1 'a) '(list2 'b) '('Inner 'a 'b '('a 'key1) '('b 'key2) '()) 
  '('('rename '"a.key1" 'q) '('rename '"b.value2" '""))))

(let res_sink (DataSink 'result))
(let world (Write! world res_sink (Key) joinInner '('('type))))

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