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

(let res_sink (DataSink 'result))
(let t1 (OptionalType (DataType 'Uint32)))
(let t2 (DataType 'String))
(let d1 (DictType t1 t2))
(let d2 (Dict d1
  '((Just (Uint32 '4)) (String 'aaa))
  '((Just (Uint32 '4)) (String 'zzz))
  '((Nothing (OptionalType (DataType 'Uint32))) (String 'bbb)))
)

(let world (Write! world res_sink (Key) d2 '()))
(let world (Write! world res_sink (Key) (Contains d2 (Just (Uint32 '4))) '()))
(let world (Write! world res_sink (Key) (Contains d2 (Nothing (OptionalType (DataType 'Uint32)))) '()))
(let world (Write! world res_sink (Key) (Contains d2 (Just (Uint32 '5))) '()))
(let world (Write! world res_sink (Key) (Contains d2 (Just (Just (Uint32 '5)))) '()))
(let world (Write! world res_sink (Key) (Contains d2 (Just (Just (Uint32 '4)))) '()))
(let world (Write! world res_sink (Key) (Contains d2 (Just (Nothing (OptionalType (DataType 'Uint32))))) '()))
(let world (Write! world res_sink (Key) (Contains d2 (Nothing (OptionalType (OptionalType (DataType 'Uint32))))) '()))
(let world (Write! world res_sink (Key) (Lookup d2 (Just (Uint32 '4))) '()))
(let world (Write! world res_sink (Key) (Lookup d2 (Nothing (OptionalType (DataType 'Uint32)))) '()))
(let world (Write! world res_sink (Key) (Lookup d2 (Just (Uint32 '5))) '()))
(let world (Write! world res_sink (Key) (Lookup d2 (Just (Just (Uint32 '4)))) '()))
(let world (Write! world res_sink (Key) (Lookup d2 (Just (Just (Uint32 '5)))) '()))
(let world (Write! world res_sink (Key) (Lookup d2 (Just (Nothing (OptionalType (DataType 'Uint32))))) '()))
(let world (Write! world res_sink (Key) (Lookup d2 (Nothing (OptionalType (OptionalType (DataType 'Uint32))))) '()))
(let world (Commit! world res_sink))
(return world)
)