aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/Epochs/FailDropAndModify1.yql
blob: 27a8f34398566338962ced7e3ad0a6c6551a238b (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;
#DROP TABLE Output;
#INSERT INTO Output SELECT key FROM Input;

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

(let conv (lambda '(item) (block '(
  (let res (Struct))
  (let res (AddMember res '"key" (Member item '"key")))
  (return (AsList res))
))))

(let world (Write! world sink (Key '('table (String 'Output))) (Void) '('('mode 'drop))))

(let r (Read! world source (Key '('table (String '"Input"))) (Void) '()))
(let world (Left! r))
(let input (Right! r))
(let out (FlatMap input conv))
(let world (Write! world sink (Key '('table (String 'Output))) out '('('mode 'append))))
(let world (Commit! world sink))

(return world)
)