aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/Optimizers/EquivInsideNestedLambdaOuterDiffLevel.yql
blob: d78e05c61f5f79e967d978c6aee7bce854cf071f (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
(
(let config (DataSource 'config))
(let world (Configure! world config 'PureDataSource 'yt))

#comment
(let res_sink (DataSink 'result))
(let outLambda1 (lambda '(sep) (block '(
   (let data (AsList (String 'a) (String 'b)))
   (let data1 (Map data (lambda '(x) (Concat x sep))))
   (let res data1)
   (return res)
))))

(let outLambda2 (lambda '(sep) (block '(
   (let data (AsList (String 'a) (String 'b)))
   (let data1 (Map data (lambda '(x) (Concat x sep))))
   (let res data1)
   (return res)
))))

(let anotherLambda (lambda '(sep) (block '(
   (let seps (AsList (Concat (String 'z) sep) (Concat (String 'y) sep)))
   (let res1 (FlatMap seps outLambda1))
   (let res2 (FlatMap seps outLambda2))
   (return (Extend res1 res2))
))))

(let predicate (== (Int32 '1) (Int32 '2)))
(let sep (If predicate (Just (String '_)) (Just (String '+))))
(let data1 (IfPresent sep outLambda1 (AsList (String 'none))))
(let data2 (IfPresent sep anotherLambda (AsList (String 'none))))
(let world (Write! world res_sink (Key) '(data1 data2) '()))
(let world (Commit! world res_sink))
(return world)
)