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

(let res_sink (DataSink 'result))
(let test (lambda '(world data) (block '(
  (let world (Write! world res_sink (Key) (ToOptional data) '('('type))))
  (return world)
))))

(let listType (ListType (DataType 'String)))
(let callableType (CallableType '() '(listType)))

(let callable1 (Callable callableType (lambda '() (List listType))))
(let callable2 (Callable callableType (lambda '() (List listType (String 'A)))))
(let callable3 (Callable callableType (lambda '() (List listType (String 'A) (String 'B)))))

(let world (Apply test world (List listType)))
(let world (Apply test world (List listType (String 'a))))
(let world (Apply test world (List listType (String 'a) (String 'b))))

(let world (Apply test world (Apply callable1)))
(let world (Apply test world (Apply callable2)))
(let world (Apply test world (Apply callable3)))

(let world (Commit! world res_sink))
(return world)
)