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

(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 'c)))
   (let data1 (Map data (lambda '(x) (Concat x sep))))
   (let res data1)
   (return res)
))))

(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 outLambda2 (AsList (String 'none))))
(let world (Write! world res_sink (Key) '(data1 data2) '()))
(let world (Commit! world res_sink))
(return world)
)