blob: a1aff3e9f195cd1d1cb48ecbe6a1e38c1fda9e97 (
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 config (DataSource 'config))
(let res_sink (DataSink 'result))
(let i32 (DataType 'Int32))
(let optI32 (OptionalType i32))
(let leftRow1 (AsStruct '('"_yql_table_index" (Uint32 '0)) '('"_yql_ljc_key_0" (Int32 '9)) '('"_yql_ljc_left_a" (Just (Int32 '1))) '('"_yql_ljc_right_b" (Nothing optI32))))
(let rightRow1 (AsStruct '('"_yql_table_index" (Uint32 '1)) '('"_yql_ljc_key_0" (Int32 '9)) '('"_yql_ljc_left_a" (Nothing optI32)) '('"_yql_ljc_right_b" (Just (Int32 '3)))))
(let leftRow2 (AsStruct '('"_yql_table_index" (Uint32 '0)) '('"_yql_ljc_key_0" (Int32 '9)) '('"_yql_ljc_left_a" (Just (Int32 '2))) '('"_yql_ljc_right_b" (Nothing optI32))))
(let rightRow2 (AsStruct '('"_yql_table_index" (Uint32 '1)) '('"_yql_ljc_key_0" (Int32 '9)) '('"_yql_ljc_left_a" (Nothing optI32)) '('"_yql_ljc_right_b" (Just (Int32 '4)))))
(let stream (Iterator (AsList leftRow1 rightRow1 leftRow2 rightRow2)))
(let keyType i32)
(let leftInputType (StructType '('"a" i32)))
(let rightInputType (StructType '('"b" i32)))
(let leftPremap (lambda '(row) (Member row '"a")))
(let rightPremap (lambda '(row) (Member row '"b")))
(let joinLambda (lambda '(key leftList rightList) (Iterator (Map (Zip leftList rightList) (lambda '(item) (AsStruct '('"a" (Nth item '0)) '('"b" (Nth item '1))))))))
(let listJoin (ListJoinCore stream keyType leftPremap leftInputType rightPremap rightInputType joinLambda))
(let world (Write! world res_sink (Key) (Collect listJoin) '('('type))))
(let world (Commit! world res_sink))
(return world)
)
|