blob: 46ad794a8bee2039274243a9888390d412218878 (
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
48
49
50
51
52
53
54
55
56
57
58
59
|
(
(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 list1 (AsList
(AsStruct '('k (String '800)))
(AsStruct '('k (String '020)))
))
(let list2 (AsList
(AsStruct '('k (String '020)))
(AsStruct '('k (String '800)))
))
(let list3 (AsList
(AsStruct '('k (String '021)))
(AsStruct '('k (String '800)))
))
(let filtered1 (FlatMap table1 (lambda '(item)
(OptionalIf (SqlIn list1 (Member item 'key) '('('tableSource)))
(AsStruct '('value (Member item 'value)) '('subkey (Member item 'subkey))))
)))
(let filtered2 (FlatMap table2 (lambda '(item) (block '(
(let sqlInPred (SqlIn list2 (Member item 'key) '('('tableSource))))
(return (OptionalIf (And sqlInPred (NotEqual (Member item 'value) (String 'ddd)))
(AsStruct '('value (Member item 'value)) '('subkey (Member item 'subkey)))))
))
)))
(let filtered3 (FlatMap table3 (lambda '(item) (block '(
(let sqlInPred (SqlIn list3 (Member item 'key) '('('tableSource))))
(return (OptionalIf (And (NotEqual (Member item 'value) (String 'q)) sqlInPred)
(AsStruct '('value (Member item 'value)) '('subkey (Member item 'subkey)))))
))
)))
(let res_sink (DataSink 'result))
(let world (Write! world res_sink (Key) (Sort filtered1 '((Bool 'true) (Bool 'true)) (lambda '(row) '((Member row 'value) (Member row 'subkey)))) '('('type))))
(let world (Write! world res_sink (Key) (Sort filtered2 '((Bool 'true) (Bool 'true)) (lambda '(row) '((Member row 'value) (Member row 'subkey)))) '('('type))))
(let world (Write! world res_sink (Key) (Sort filtered3 '((Bool 'true) (Bool 'true)) (lambda '(row) '((Member row 'value) (Member row 'subkey)))) '('('type))))
(let world (Commit! world res_sink))
(return world)
)
|