aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/Epochs/Bug2318.yql
blob: 5734271142a03bdca701e70f4b0d4f8edb63fae4 (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
#USE plato;
#INSERT INTO Output WITH TRUNCATE SELECT key FROM Input;
#COMMIT;
#INSERT INTO Output WITH TRUNCATE SELECT key FROM CONCAT(Input, Output);

(
(let source (DataSource '"yt" '"plato"))
(let sink (DataSink '"yt" '"plato"))
(let result (DataSink 'result))

(let read (Read! world source (MrTableConcat (Key '('table (String '"Input")))) '('"key") '()))
(let world (Left! read))
(let input (Right! read))
(let output (FlatMap input (lambda '(item) (AsList (AsStruct '('"key" (Member item '"key")))))))
(let world (Write! world sink (Key '('table (String '"Output"))) output '('('mode 'renew))))
(let world (Commit! world sink))

(let read (Read! world source (MrTableConcat (Key '('table (String '"Input"))) (Key '('table (String '"Output")))) '('"key") '()))
(let world (Left! read))
(let input (Right! read))
(let output (FlatMap input (lambda '(item) (AsList (AsStruct '('"key" (Member item '"key")))))))
(let world (Write! world sink (Key '('table (String '"Output"))) output '('('mode 'renew))))
(let world (Commit! world sink))

(return world)
)