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

(let res_sink (DataSink 'result))

(let value (AsStruct '('a (Int8 '1)) '('b (Just (String 'str))) '('c '((Int32 '2) (Int64 '3)))))
(let flattenMembersResult (FlattenMembers '('"" (Just value))))
(let world (Write! world res_sink (Key) flattenMembersResult '('('type))))

(let value (Nothing (TypeOf (Just value))))
(let flattenMembersResult (FlattenMembers '('"x" value)))
(let world (Write! world res_sink (Key) flattenMembersResult '('('type))))

(let value (AsStruct))
(let flattenMembersResult (FlattenMembers '('"x" value)))
(let world (Write! world res_sink (Key) flattenMembersResult '('('type))))

(let value (Just (AsStruct)))
(let flattenMembersResult (FlattenMembers '('"" value)))
(let world (Write! world res_sink (Key) flattenMembersResult '('('type))))

(let value (Nothing (TypeOf value)))
(let flattenMembersResult (FlattenMembers '('"x" value)))
(let world (Write! world res_sink (Key) flattenMembersResult '('('type))))

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

)