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

(
(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 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 (Write! world sink (Key '('table (String 'Output))) (Void) '('('mode 'drop))))

(let world (Commit! world sink))

(return world)
)