aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/s-expressions/suites/Casts/AlterToOverTuple.yql
blob: 3ad49c4744cd4f09c31ba8a2f85f30b2b85e6537 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(

(library "alterto.yql")
(import alterto_module '"alterto.yql")

(let config (DataSource 'config))
(let world (Configure! world config 'PureDataSource 'yt))

(let targetType (TupleType (DataType 'Uint8) (DataType 'Utf8)))
(let failValue '((Uint8 '0) (Utf8 '"not converted")))

# (Int32, String) -> (Uint8, Utf8)
(let value '((Int32 '1) (String 'one)))
(let world (Apply (bind alterto_module 'doAlterTo) world value targetType failValue))

# (Int32, String) -> (Uint8, Utf8) (fail)
(let value '((Int32 '1) (String '"garbage\xff")))
(let world (Apply (bind alterto_module 'doAlterTo) world value targetType failValue))

(return world)

)