diff options
author | Maxim Yurchuk <maxim-yurchuk@ydb.tech> | 2024-11-20 17:37:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-20 17:37:57 +0000 |
commit | f76323e9b295c15751e51e3443aa47a36bee8023 (patch) | |
tree | 4113c8cad473a33e0f746966e0cf087252fa1d7a /yql/essentials/tests/s-expressions/suites/ImplictCasts | |
parent | 753ecb8d410a4cb459c26f3a0082fb2d1724fe63 (diff) | |
parent | a7b9a6afea2a9d7a7bfac4c5eb4c1a8e60adb9e6 (diff) | |
download | ydb-f76323e9b295c15751e51e3443aa47a36bee8023.tar.gz |
Merge pull request #11788 from ydb-platform/mergelibs-241120-1113
Library import 241120-1113
Diffstat (limited to 'yql/essentials/tests/s-expressions/suites/ImplictCasts')
81 files changed, 1328 insertions, 0 deletions
diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Arithmetic.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Arithmetic.yql new file mode 100644 index 0000000000..dfc37d30de --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Arithmetic.yql @@ -0,0 +1,33 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let res (List (ListType (DataType 'Uint64)))) +(let res (Append res (+ (Int32 '5) (Uint64 '5)))) +(let res (Append res (+ (Int32 '-5) (Uint64 '5)))) +(let res (Append res (+ (Uint64 '5) (Int32 '-5)))) +(let world (Write! world res_sink (Key) res '('('type)))) +(let res (List (ListType (DataType 'Uint64)))) +(let res (Append res (- (Int32 '5) (Uint64 '5)))) +(let res (Append res (- (Int32 '-5) (Uint64 '5)))) +(let res (Append res (- (Uint64 '5) (Int32 '-5)))) +(let world (Write! world res_sink (Key) res '('('type)))) +(let res (List (ListType (DataType 'Uint64)))) +(let res (Append res (* (Int32 '5) (Uint64 '5)))) +(let res (Append res (* (Int32 '-5) (Uint64 '5)))) +(let res (Append res (* (Uint64 '5) (Int32 '-5)))) +(let world (Write! world res_sink (Key) res '('('type)))) +(let res (List (ListType (OptionalType (DataType 'Uint64))))) +(let res (Append res (/ (Int32 '5) (Uint64 '5)))) +(let res (Append res (/ (Int32 '-5) (Uint64 '5)))) +(let res (Append res (/ (Uint64 '5) (Int32 '-5)))) +(let world (Write! world res_sink (Key) res '('('type)))) +(let res (List (ListType (OptionalType (DataType 'Uint64))))) +(let res (Append res (% (Int32 '5) (Uint64 '5)))) +(let res (Append res (% (Int32 '-5) (Uint64 '5)))) +(let res (Append res (% (Uint64 '5) (Int32 '-5)))) +(let world (Write! world res_sink (Key) res '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AsListInferCommonTypeOpt.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AsListInferCommonTypeOpt.yql new file mode 100644 index 0000000000..9e4f52e93d --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AsListInferCommonTypeOpt.yql @@ -0,0 +1,28 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +# Int32, Uint16??? -> Int32??? +(let data (AsList (Int32 '1) (Just (Just (Just (Uint16 '2)))))) +(let world (Write! world res_sink (Key) data '('('type)))) + +# Int32?, Uint16??? -> Int32??? +(let data (AsList (Just (Int32 '1)) (Just (Just (Just (Uint16 '2)))))) +(let world (Write! world res_sink (Key) data '('('type)))) + +# Int64?, Null -> Int64? +(let data (AsList (Just (Int64 '1)) (Null))) +(let world (Write! world res_sink (Key) data '('('type)))) + +# Int64?, Nothing(Null?) -> Int64?? +(let data (AsList (Just (Int64 '1)) (Nothing (OptionalType (NullType))))) +(let world (Write! world res_sink (Key) data '('('type)))) + +# Int64?, Nothing(Null?)? -> Int64??? +(let data (AsList (Just (Int64 '1)) (Just (Nothing (OptionalType (NullType)))))) +(let world (Write! world res_sink (Key) data '('('type)))) + +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvert.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvert.yql new file mode 100644 index 0000000000..a326656deb --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvert.yql @@ -0,0 +1,35 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (Int32 '1))) +(let data (Append data (Uint8 '2))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Uint32 '1))) +(let data (Append data (Uint8 '2))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Uint64 '1))) +(let data (Append data (Uint8 '2))) +(let data (Append data (Uint32 '2))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Int64 '1))) +(let data (Append data (Uint8 '2))) +(let data (Append data (Int32 '2))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Float '1))) +(let data (Append data (Uint8 '2))) +(let data (Append data (Int32 '2))) +(let data (Append data (Uint32 '2))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Double '1))) +(let data (Append data (Uint8 '2))) +(let data (Append data (Int32 '2))) +(let data (Append data (Uint32 '2))) +(let data (Append data (Int64 '2))) +(let data (Append data (Uint64 '2))) +(let data (Append data (Float '2))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByBinContent.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByBinContent.yql new file mode 100644 index 0000000000..d3a2fa7c5a --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByBinContent.yql @@ -0,0 +1,38 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (Uint8 '1))) +(let data (Append data (Uint32 'x"02000000"))) +(let data (Append data (Int32 'x"02000000"))) +(let data (Append data (Uint64 'x"0200000000000000"))) +(let data (Append data (Int64 'x"0200000000000000"))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Int32 '1))) +(let data (Append data (Uint32 'x"02000000"))) +(let data (Append data (Int32 'x"02000000"))) +(let data (Append data (Uint64 'x"0200000000000000"))) +(let data (Append data (Int64 'x"0200000000000000"))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Uint32 '1))) +(let data (Append data (Uint32 'x"02000000"))) +(let data (Append data (Int32 'x"02000000"))) +(let data (Append data (Uint64 'x"0200000000000000"))) +(let data (Append data (Int64 'x"0200000000000000"))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Int64 '1))) +(let data (Append data (Uint32 'x"02000000"))) +(let data (Append data (Int32 'x"02000000"))) +(let data (Append data (Uint64 'x"0200000000000000"))) +(let data (Append data (Int64 'x"0200000000000000"))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Uint64 '1))) +(let data (Append data (Uint32 'x"02000000"))) +(let data (Append data (Int32 'x"02000000"))) +(let data (Append data (Uint64 'x"0200000000000000"))) +(let data (Append data (Int64 'x"0200000000000000"))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByContent.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByContent.yql new file mode 100644 index 0000000000..478ba0b492 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByContent.yql @@ -0,0 +1,38 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (Uint8 '1))) +(let data (Append data (Uint32 '2))) +(let data (Append data (Int32 '2))) +(let data (Append data (Uint64 '2))) +(let data (Append data (Int64 '2))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Int32 '1))) +(let data (Append data (Uint32 '2))) +(let data (Append data (Int32 '2))) +(let data (Append data (Uint64 '2))) +(let data (Append data (Int64 '2))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Uint32 '1))) +(let data (Append data (Uint32 '2))) +(let data (Append data (Int32 '2))) +(let data (Append data (Uint64 '2))) +(let data (Append data (Int64 '2))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Int64 '1))) +(let data (Append data (Uint32 '2))) +(let data (Append data (Int32 '2))) +(let data (Append data (Uint64 '2))) +(let data (Append data (Int64 '2))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Uint64 '1))) +(let data (Append data (Uint32 '2))) +(let data (Append data (Int32 '2))) +(let data (Append data (Uint64 '2))) +(let data (Append data (Int64 '2))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByIf.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByIf.yql new file mode 100644 index 0000000000..1008cf6499 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByIf.yql @@ -0,0 +1,11 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (Uint64 '1)) +(let data (If (Bool 'true) data (Double '2))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByMinusContent.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByMinusContent.yql new file mode 100644 index 0000000000..afe7c04735 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByMinusContent.yql @@ -0,0 +1,42 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (Uint8 '1))) +(let data (Append data (Minus (Int32 '-2)))) +(let data (Append data (Minus (Uint32 'x"FCFFFFFF")))) +(let data (Append data (Minus (Int64 '-2)))) +(let data (Append data (Minus (Uint64 'x"FCFFFFFFFFFFFFFF")))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Int32 '1))) +(let data (Append data (Minus (Int32 '-2)))) +(let data (Append data (Minus (Int32 '2)))) +(let data (Append data (Minus (Uint32 'x"FCFFFFFF")))) +(let data (Append data (Minus (Int64 '-2)))) +(let data (Append data (Minus (Int64 '2)))) +(let data (Append data (Minus (Uint64 'x"FCFFFFFFFFFFFFFF")))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Uint32 '1))) +(let data (Append data (Minus (Int32 '-2)))) +(let data (Append data (Minus (Uint32 'x"FCFFFFFF")))) +(let data (Append data (Minus (Int64 '-2)))) +(let data (Append data (Minus (Uint64 'x"FCFFFFFFFFFFFFFF")))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Int64 '1))) +(let data (Append data (Minus (Int32 '-2)))) +(let data (Append data (Minus (Int32 '2)))) +(let data (Append data (Minus (Uint32 'x"FCFFFFFF")))) +(let data (Append data (Minus (Int64 '-2)))) +(let data (Append data (Minus (Int64 '2)))) +(let data (Append data (Minus (Uint64 'x"FCFFFFFFFFFFFFFF")))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Uint64 '1))) +(let data (Append data (Minus (Int32 '-2)))) +(let data (Append data (Minus (Uint32 'x"FCFFFFFF")))) +(let data (Append data (Minus (Int64 '-2)))) +(let data (Append data (Minus (Uint64 'x"FCFFFFFFFFFFFFFF")))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByPlusContent.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByPlusContent.yql new file mode 100644 index 0000000000..27ac41dba1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertByPlusContent.yql @@ -0,0 +1,38 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (Uint8 '1))) +(let data (Append data (Plus (Uint32 '2)))) +(let data (Append data (Plus (Int32 '2)))) +(let data (Append data (Plus (Uint64 '2)))) +(let data (Append data (Plus (Int64 '2)))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Int32 '1))) +(let data (Append data (Plus (Uint32 '2)))) +(let data (Append data (Plus (Int32 '2)))) +(let data (Append data (Plus (Uint64 '2)))) +(let data (Append data (Plus (Int64 '2)))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Uint32 '1))) +(let data (Append data (Plus (Uint32 '2)))) +(let data (Append data (Plus (Int32 '2)))) +(let data (Append data (Plus (Uint64 '2)))) +(let data (Append data (Plus (Int64 '2)))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Int64 '1))) +(let data (Append data (Plus (Uint32 '2)))) +(let data (Append data (Plus (Int32 '2)))) +(let data (Append data (Plus (Uint64 '2)))) +(let data (Append data (Plus (Int64 '2)))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (AsList (Uint64 '1))) +(let data (Append data (Plus (Uint32 '2)))) +(let data (Append data (Plus (Int32 '2)))) +(let data (Append data (Plus (Uint64 '2)))) +(let data (Append data (Plus (Int64 '2)))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesce.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesce.yql new file mode 100644 index 0000000000..9977eefc30 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesce.yql @@ -0,0 +1,16 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (Coalesce (Nothing (OptionalType (DataType 'Uint32))) (Uint64 '1))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (Coalesce (Nothing (OptionalType (DataType 'Uint64))) (Int64 '2))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (Coalesce (Nothing (OptionalType (DataType 'Int64))) (+ (Uint32 '1) (Uint32 '2)))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (Coalesce (Nothing (OptionalType (DataType 'Uint32))) (Just (Uint32 '4)))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesceSrtucts.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesceSrtucts.yql new file mode 100644 index 0000000000..4ea96cadab --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoConvertCoalesceSrtucts.yql @@ -0,0 +1,10 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (Coalesce (AsStruct '('"a" (Int32 '1))) (AsStruct))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJust.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJust.yql new file mode 100644 index 0000000000..ce67a47d55 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJust.yql @@ -0,0 +1,11 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (Just (Just (String 'a))))) +(let data (Append data (String 'b))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJustByIf.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJustByIf.yql new file mode 100644 index 0000000000..88c2e397a7 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/AutoJustByIf.yql @@ -0,0 +1,11 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (Just (Just (String 'a)))) +(let data (If (Bool 'true) data (String 'b))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Compare.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Compare.yql new file mode 100644 index 0000000000..3f2fa9519d --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Compare.yql @@ -0,0 +1,42 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let res (List (ListType (DataType 'Bool)))) +(let res (Append res (== (Int32 '5) (Uint64 '5)))) +(let res (Append res (== (Int32 '-5) (Uint64 '5)))) +(let res (Append res (== (Uint64 '5) (Int32 '-5)))) +(let world (Write! world res_sink (Key) res '('('type)))) +(let res (List (ListType (DataType 'Bool)))) +(let res (Append res (!= (Int32 '5) (Uint64 '5)))) +(let res (Append res (!= (Int32 '-5) (Uint64 '5)))) +(let res (Append res (!= (Uint64 '5) (Int32 '-5)))) +(let world (Write! world res_sink (Key) res '('('type)))) +(let res (List (ListType (DataType 'Bool)))) +(let res (Append res (< (Int32 '5) (Uint64 '5)))) +(let res (Append res (< (Int32 '-1) (Uint64 '5)))) +(let res (Append res (< (Int32 '1) (Uint64 '5)))) +(let res (Append res (< (Uint64 '1) (Int32 '-2)))) +(let world (Write! world res_sink (Key) res '('('type)))) +(let res (List (ListType (DataType 'Bool)))) +(let res (Append res (<= (Int32 '5) (Uint64 '5)))) +(let res (Append res (<= (Int32 '-1) (Uint64 '5)))) +(let res (Append res (<= (Int32 '1) (Uint64 '5)))) +(let res (Append res (<= (Uint64 '1) (Int32 '-2)))) +(let world (Write! world res_sink (Key) res '('('type)))) +(let res (List (ListType (DataType 'Bool)))) +(let res (Append res (> (Int32 '5) (Uint64 '5)))) +(let res (Append res (> (Int32 '-1) (Uint64 '5)))) +(let res (Append res (> (Int32 '1) (Uint64 '5)))) +(let res (Append res (> (Uint64 '1) (Int32 '-2)))) +(let world (Write! world res_sink (Key) res '('('type)))) +(let res (List (ListType (DataType 'Bool)))) +(let res (Append res (>= (Int32 '5) (Uint64 '5)))) +(let res (Append res (>= (Int32 '-1) (Uint64 '5)))) +(let res (Append res (>= (Int32 '1) (Uint64 '5)))) +(let res (Append res (>= (Uint64 '1) (Int32 '-2)))) +(let world (Write! world res_sink (Key) res '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Enumerate.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Enumerate.yql new file mode 100644 index 0000000000..20547b0aaa --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Enumerate.yql @@ -0,0 +1,10 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (Enumerate (AsList (String 'a) (String 'b)) (Int64 '2) (Uint32 '1))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverData.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverData.yql new file mode 100644 index 0000000000..4da2353218 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverData.yql @@ -0,0 +1,30 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) + +# result is true for all tests below + +# To float +(let value (Uint64 '18446744073709551615)) +(let commonType (DataType 'Float)) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# To double +(let value (Int64 '"-9223372036854775808")) +(let commonType (DataType 'Double)) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# To string +(let value (Utf8 '"проверка")) +(let commonType (DataType 'String)) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +(let world (Commit! world res_sink)) +(return world) + +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDataIntegralTypes.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDataIntegralTypes.yql new file mode 100644 index 0000000000..bab448cfa0 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDataIntegralTypes.yql @@ -0,0 +1,70 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) + +# Both signed (true) +(let value (Int32 '0)) +(let commonType (DataType 'Int64)) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# Both unsigned (true) +(let value (Uint8 '0)) +(let commonType (DataType 'Uint16)) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# uint32(0) -> int32 (true) +(let value (Uint32 '0)) +(let commonType (DataType 'Int32)) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# uint32(2^31-1) -> int32 (true) +(let value (Uint32 '2147483647)) +(let commonType (DataType 'Int32)) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# uint32(2^31) -> int32 (false) +(let value (Uint32 '2147483648)) +(let commonType (DataType 'Int32)) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# uint32(2^32-1) -> int32 (false) +(let value (Uint32 '4294967295)) +(let commonType (DataType 'Int32)) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# int16(0) -> uint32 (true) +(let value (Int16 '0)) +(let commonType (DataType 'Uint32)) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# int16(32767) -> uint32 (true) +(let value (Int16 '32767)) +(let commonType (DataType 'Uint32)) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# int16(-1) -> uint32 (false) +(let value (Int16 '"-1")) +(let commonType (DataType 'Uint32)) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# int16(-32768) -> uint32 (false) +(let value (Int16 '"-32768")) +(let commonType (DataType 'Uint32)) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +(let world (Commit! world res_sink)) +(return world) + +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDict.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDict.yql new file mode 100644 index 0000000000..17dbdd3de4 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverDict.yql @@ -0,0 +1,23 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) + +# Dict<Uint32, Int16>> -> Dict<Uint32, Uint64> (false) +(let value (AsDict '((Uint32 '0) (Int16 '"-1")))) +(let commonType (DictType (DataType 'Uint32) (DataType 'Uint64))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# Dict<Uint32, Uint16>> -> Dict<Uint32, Uint64> (true) +(let value (AsDict '((Uint32 '0) (Uint16 '0)))) +(let commonType (DictType (DataType 'Uint32) (DataType 'Uint64))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + + +(let world (Commit! world res_sink)) +(return world) + +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverList.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverList.yql new file mode 100644 index 0000000000..9622fabe4b --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverList.yql @@ -0,0 +1,24 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) + +# List<Uint16> -> List<Int16> (false) +(let value (AsList (Uint16 '32767))) +(let value (Append value (Uint16 '32768))) +(let commonType (ListType (DataType 'Int16))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# List<Uint16> -> List<UInt32> (true) +(let value (AsList (Uint16 '32767))) +(let value (Append value (Uint16 '32768))) +(let commonType (ListType (DataType 'Uint32))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +(let world (Commit! world res_sink)) +(return world) + +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverOptional.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverOptional.yql new file mode 100644 index 0000000000..468cab9df7 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverOptional.yql @@ -0,0 +1,30 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) + +# result is true for all tests below + +# Int32 -> Uint64?? (false) +(let value (Int32 '"-1")) +(let commonType (OptionalType (OptionalType (DataType 'Uint64)))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# Just(Int32) -> Uint64?? (false) +(let value (Just (Int32 '"-1"))) +(let commonType (OptionalType (OptionalType (DataType 'Uint64)))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# Nothing(Int32)? -> Uint64?? (true) +(let value (Just (Nothing (OptionalType (DataType 'Int32))))) +(let commonType (OptionalType (OptionalType (DataType 'Uint64)))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +(let world (Commit! world res_sink)) +(return world) + +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverStruct.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverStruct.yql new file mode 100644 index 0000000000..ae8830e61f --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverStruct.yql @@ -0,0 +1,22 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) + +# Struct<Int16, Int16>> -> Struct<Uint32, Uint64> (false) +(let value (AsStruct '('"a" (Int16 '0)) '('"b" (Int16 '"-1")))) +(let commonType (StructType '('"a" (DataType 'Uint32)) '('"b" (DataType 'Uint64)))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# Struct<Uint16, Uint16>> -> Struct<Uint32, Uint64> (true) +(let value (AsStruct '('"a" (Uint16 '0)) '('"b" (Uint16 '0)))) +(let commonType (StructType '('"a" (DataType 'Uint32)) '('"b" (DataType 'Uint64)))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +(let world (Commit! world res_sink)) +(return world) + +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverTuple.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverTuple.yql new file mode 100644 index 0000000000..3461a8d239 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverTuple.yql @@ -0,0 +1,22 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) + +# (Int16, Int16, Int16, Int16, Int16) -> (Uint32, Uint32, Uint64, Uint32, Uint64) (false) +(let value '((Int16 '0) (Int16 '"-1") (Int16 '0) (Int16 '0) (Int16 '0))) +(let commonType (TupleType (DataType 'Uint32) (DataType 'Uint32) (DataType 'Uint64) (DataType 'Uint32) (DataType 'Uint64))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# (Uint16, Uint16, Uint16, Uint16, Uint16) -> (Uint32, Uint32, Uint64, Uint32, Uint64) (true) +(let value '((Uint16 '0) (Uint16 '0) (Uint16 '0) (Uint16 '0) (Uint16 '0))) +(let commonType (TupleType (DataType 'Uint32) (DataType 'Uint32) (DataType 'Uint64) (DataType 'Uint32) (DataType 'Uint64))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +(let world (Commit! world res_sink)) +(return world) + +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantStruct.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantStruct.yql new file mode 100644 index 0000000000..a6de909851 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantStruct.yql @@ -0,0 +1,24 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) + +# Variant<Struct<Int16, Int16>>> -> Variant<Struct<Uint32, Uint64>> (false) +(let variantType (VariantType (StructType '('"a" (DataType 'Int16)) '('"b" (DataType 'Int16))))) +(let value (Variant (Int16 '"-1") '"a" variantType)) +(let commonType (VariantType (StructType '('"a" (DataType 'Uint32)) '('"b" (DataType 'Uint64))))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# Variant<Struct<Uint16, Uint16>>> -> Variant<Struct<Uint32, Uint64>> (true) +(let variantType (VariantType (StructType '('"a" (DataType 'Uint16)) '('"b" (DataType 'Uint16))))) +(let value (Variant (Uint16 '0) '"a" variantType)) +(let commonType (VariantType (StructType '('"a" (DataType 'Uint32)) '('"b" (DataType 'Uint64))))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +(let world (Commit! world res_sink)) +(return world) + +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantTuple.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantTuple.yql new file mode 100644 index 0000000000..28dd639e69 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/ImplicitEqualsOverVariantTuple.yql @@ -0,0 +1,24 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) + +# Variant<Tuple<Int16, Int32>>> -> Variant<Tuple<Uint32, Uint64>> (false) +(let variantType (VariantType (TupleType (DataType 'Int16) (DataType 'Int32)))) +(let value (Variant (Int32 '"-1") '1 variantType)) +(let commonType (VariantType (TupleType (DataType 'Uint32) (DataType 'Uint64)))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +# Variant<Tuple<Uint16, Uint32>>> -> Variant<Tuple<Uint32, Uint64>> (true) +(let variantType (VariantType (TupleType (DataType 'Uint16) (DataType 'Uint32)))) +(let value (Variant (Uint32 '0) '1 variantType)) +(let commonType (VariantType (TupleType (DataType 'Uint32) (DataType 'Uint64)))) +(let imlicitEqualsResult (Exists (StrictCast value commonType))) +(let world (Write! world res_sink (Key) imlicitEqualsResult '('('type)))) + +(let world (Commit! world res_sink)) +(return world) + +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideDictLiteral.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideDictLiteral.yql new file mode 100644 index 0000000000..f7393666cc --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideDictLiteral.yql @@ -0,0 +1,13 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (AsDict '((Uint32 '12) (Uint32 '34))))) +(let data (Append data (AsDict '((Uint32 '56) (Int64 '78))))) +(let dt (DictType (DataType 'Uint32) (DataType 'Int64))) +(let data (Append data (Dict dt '((Uint32 '90) (Int64 '12))))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideList.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideList.yql new file mode 100644 index 0000000000..b2259327f1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideList.yql @@ -0,0 +1,11 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (AsList (Int64 '12)))) +(let data (Append data (AsList (Int32 '-5)))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideListLiteral.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideListLiteral.yql new file mode 100644 index 0000000000..bd0adcd454 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideListLiteral.yql @@ -0,0 +1,13 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (AsList (Uint32 '12)))) +(let data (Append data (AsList (Int64 '34)))) +(let lt (ListType (DataType 'Int64))) +(let data (Append data (List lt (Int64 '56)))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOpt.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOpt.yql new file mode 100644 index 0000000000..ddf3ad70b0 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOpt.yql @@ -0,0 +1,11 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (Just (Int64 '12)))) +(let data (Append data (Just (Int32 '-5)))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOptLiteral.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOptLiteral.yql new file mode 100644 index 0000000000..52b4d2872a --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideOptLiteral.yql @@ -0,0 +1,11 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (Just (Uint32 '12)))) +(let data (Append data (Just (Int64 '34)))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStruct.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStruct.yql new file mode 100644 index 0000000000..4bf5f79adb --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStruct.yql @@ -0,0 +1,11 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (AsStruct '('key (Just (Int64 '12)))))) +(let data (Append data (AsStruct '('key (Int64 '34))))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStructLiteral.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStructLiteral.yql new file mode 100644 index 0000000000..69051e7c19 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideStructLiteral.yql @@ -0,0 +1,13 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (AsStruct '('x (Uint32 '12))))) +(let data (Append data (AsStruct '('x (Int64 '34))))) +(let st (StructType '('x (DataType 'Int64)))) +(let data (Append data (Struct st '('x (Int64 '56))))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTuple.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTuple.yql new file mode 100644 index 0000000000..a06b03fe9d --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTuple.yql @@ -0,0 +1,11 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList '((Just (Int64 '12))))) +(let data (Append data '((Int64 '34)))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTupleLiteral.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTupleLiteral.yql new file mode 100644 index 0000000000..28da7c8617 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideTupleLiteral.yql @@ -0,0 +1,11 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList '((Uint32 '12)))) +(let data (Append data '((Int64 '34)))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariant.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariant.yql new file mode 100644 index 0000000000..2acee2f12b --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariant.yql @@ -0,0 +1,54 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +# Variant over tuple + +(let vt (ParseType '"Variant<Int64, Struct<A:Int64, B:Double>>")) +(let vt2 (ParseType '"Variant<Int32, Struct<A:Int32, B:Double>>")) + +(let testcase1 (AsList (Variant (Int64 '10) '0 vt))) + +(let argBody (lambda '() (Variant (Int32 '11) '0 vt2))) +(let argType (CallableType '() '(vt2))) +(let argCallable (Callable argType argBody)) +(let arg (Apply argCallable)) +(let testcase1 (Append testcase1 arg)) + +(let argBody (lambda '() (Variant (AsStruct '('A (Int64 '25)) '('B (Double '15.5))) '1 vt2))) +(let argType (CallableType '() '(vt2))) +(let argCallable (Callable argType argBody)) +(let arg (Apply argCallable)) +(let testcase1 (Append testcase1 arg)) + +# Variant over struct + +(let vts (ParseType '"Variant<A:Int64, B:Struct<A:Int64, B:Double>>")) +(let vts2 (ParseType '"Variant<A:Int32, B:Struct<A:Int32, B:Double>>")) +(let vts3 (ParseType '"Variant<A:Int32>")) + +(let testcase2 (AsList (Variant (Int64 '10) 'A vts))) + +(let argBody (lambda '() (Variant (Int32 '11) 'A vts2))) +(let argType (CallableType '() '(vts2))) +(let argCallable (Callable argType argBody)) +(let arg (Apply argCallable)) +(let testcase2 (Append testcase2 arg)) + +(let argBody (lambda '() (Variant (AsStruct '('A (Int64 '25)) '('B (Double '15.5))) 'B vts2))) +(let argType (CallableType '() '(vts2))) +(let argCallable (Callable argType argBody)) +(let arg (Apply argCallable)) +(let testcase2 (Append testcase2 arg)) + +(let argBody (lambda '() (Variant (Int32 '11) 'A vts3))) +(let argType (CallableType '() '(vts3))) +(let argCallable (Callable argType argBody)) +(let arg (Apply argCallable)) +(let testcase2 (Append testcase2 arg)) + +(let world (Write! world res_sink (Key) '(testcase1 testcase2) '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariantLiteral.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariantLiteral.yql new file mode 100644 index 0000000000..bbc1bfa584 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/InsideVariantLiteral.yql @@ -0,0 +1,29 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +# Variant over struct + +(let vt (ParseType '"Variant<Int64, Struct<A:Int64, B:Double>>")) +(let vt2 (ParseType '"Variant<Int32, Struct<A:Int32, B:Double>>")) + +(let testcase1 (AsList (Variant (Int64 '10) '0 vt))) +(let testcase1 (Append testcase1 (Variant (Int32 '11) '0 vt2))) +(let testcase1 (Append testcase1 (Variant (AsStruct '('A (Int64 '25)) '('B (Double '15.5))) '1 vt2))) + +# Variant over tuple + +(let vts (ParseType '"Variant<A:Int64, B:Struct<A:Int64, B:Double>>")) +(let vts2 (ParseType '"Variant<A:Int32, B:Struct<A:Int32, B:Double>>")) +(let vts3 (ParseType '"Variant<A:Int32>")) + +(let testcase2 (AsList (Variant (Int64 '10) 'A vts))) +(let testcase2 (Append testcase2 (Variant (Int32 '11) 'A vts2))) +(let testcase2 (Append testcase2 (Variant (AsStruct '('A (Int64 '25)) '('B (Double '15.5))) 'B vts2))) +(let testcase2 (Append testcase2 (Variant (Int32 '11) 'A vts3))) + +(let world (Write! world res_sink (Key) '(testcase1 testcase2) '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/NarrowStruct.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/NarrowStruct.yql new file mode 100644 index 0000000000..8c5bc62595 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/NarrowStruct.yql @@ -0,0 +1,11 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (AsStruct '('key (Just (Int64 '12)))))) +(let data (Append data (AsStruct '('key (Int64 '34)) '('value (String 'foo))))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/NullAsOpt.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/NullAsOpt.yql new file mode 100644 index 0000000000..cf59f2bb0c --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/NullAsOpt.yql @@ -0,0 +1,11 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let ct (ParseType '"(Uint32?,Uint32)->Uint32")) +(let callable (Callable ct (lambda '(x y) (Coalesce x y)))) +(let world (Write! world res_sink (Key) (Apply callable (Null) (Uint32 '2)) '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Shift.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Shift.yql new file mode 100644 index 0000000000..718fabeac3 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Shift.yql @@ -0,0 +1,25 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (ShiftLeft (Int32 '"1") (Int64 '"10"))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (ShiftLeft (Int64 '"1") (Int64 '"10"))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (ShiftLeft (Int32 '"1") (Int64 '"40"))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (ShiftLeft (Int64 '"1") (Int64 '"40"))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(let data (ShiftLeft (Just (Int32 '"1")) (Int64 '"10"))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (ShiftLeft (Just (Int64 '"1")) (Int64 '"10"))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (ShiftLeft (Just (Int32 '"1")) (Int64 '"40"))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let data (ShiftLeft (Just (Int64 '"1")) (Int64 '"40"))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Skip.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Skip.yql new file mode 100644 index 0000000000..e906d237e5 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Skip.yql @@ -0,0 +1,10 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (Skip (AsList (String 'a) (String 'b)) (Int64 '1))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Substring.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Substring.yql new file mode 100644 index 0000000000..2de7c5efe9 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Substring.yql @@ -0,0 +1,10 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (Substring (String 'abcde) (Int64 '2) (Uint64 '1))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/Take.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Take.yql new file mode 100644 index 0000000000..b91a23e1de --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/Take.yql @@ -0,0 +1,10 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (Take (AsList (String 'a) (String 'b)) (Int64 '1))) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.yql new file mode 100644 index 0000000000..a2d9759568 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructExtraItemsFail.yql @@ -0,0 +1,19 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32))))) +(let orig (Variant (Int32 '0) 'B origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)) '('D (DataType 'Int32))))) +(let test (Variant (Int32 '0) 'B testType)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.yql new file mode 100644 index 0000000000..ac57358f03 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructNameMismatchFail.yql @@ -0,0 +1,19 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32))))) +(let orig (Variant (Int32 '0) 'B origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('X (DataType 'Int32))))) +(let test (Variant (Int32 '0) 'B testType)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.yql new file mode 100644 index 0000000000..a4e5f7dd40 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetNameMismatchFail.yql @@ -0,0 +1,19 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32))))) +(let orig (Variant (Int32 '0) 'B origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (StructType '('A (DataType 'Int32)) '('X (DataType 'Int32)) '('C (DataType 'Int32))))) +(let test (Variant (Int32 '0) 'X testType)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.yql new file mode 100644 index 0000000000..a7bfc3ca2a --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTargetTypeMismatchFail.yql @@ -0,0 +1,19 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32))))) +(let orig (Variant (Int32 '0) 'B origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Float)) '('C (DataType 'Int32))))) +(let test (Variant (Float '0) 'B testType)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.yql new file mode 100644 index 0000000000..cc6a372e44 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverStructTypeMismatchFail.yql @@ -0,0 +1,19 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32))))) +(let orig (Variant (Int32 '0) 'B origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Float))))) +(let test (Variant (Int32 '0) 'B testType)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.yql new file mode 100644 index 0000000000..d6e73eab29 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleExtraItemsFail.yql @@ -0,0 +1,19 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let orig (Variant (Int32 '0) '1 origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let test (Variant (Int32 '0) '1 testType)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.yql new file mode 100644 index 0000000000..e0419e94da --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleNotEnoughItemsFail.yql @@ -0,0 +1,19 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let orig (Variant (Int32 '0) '1 origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let test (Variant (Int32 '0) '1 testType)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.yql new file mode 100644 index 0000000000..615950d586 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTargetTypeMismatchFail.yql @@ -0,0 +1,19 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let orig (Variant (Int32 '0) '1 origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Float) (DataType 'Int32)))) +(let test (Variant (Float '0) '1 testType)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.yql new file mode 100644 index 0000000000..b9d7408383 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralOverTupleTypeMismatchFail.yql @@ -0,0 +1,19 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let orig (Variant (Int32 '0) '1 origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Float)))) +(let test (Variant (Int32 '0) '1 testType)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.yql new file mode 100644 index 0000000000..d58f23fe27 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantLiteralUnderlyingTypeMismatchFail.yql @@ -0,0 +1,19 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32))))) +(let orig (Variant (Int32 '0) 'B origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let test (Variant (Int32 '0) '1 testType)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.yql new file mode 100644 index 0000000000..80492a709e --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructExtraItemsFail.yql @@ -0,0 +1,22 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32))))) +(let orig (Variant (Int32 '0) 'B origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32)) '('D (DataType 'Int32))))) +(let testCallableType (CallableType '() '(testType))) +(let testBody (lambda '() (Variant (Int32 '0) 'B testType))) +(let testCallable (Callable testCallableType testBody)) +(let test (Apply testCallable)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.yql new file mode 100644 index 0000000000..b71b50dff7 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructNameMismatchFail.yql @@ -0,0 +1,22 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32))))) +(let orig (Variant (Int32 '0) 'B origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('X (DataType 'Int32))))) +(let testCallableType (CallableType '() '(testType))) +(let testBody (lambda '() (Variant (Int32 '0) 'B testType))) +(let testCallable (Callable testCallableType testBody)) +(let test (Apply testCallable)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.yql new file mode 100644 index 0000000000..bd91e105e0 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetNameMismatchFail.yql @@ -0,0 +1,22 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32))))) +(let orig (Variant (Int32 '0) 'B origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (StructType '('A (DataType 'Int32)) '('X (DataType 'Int32)) '('C (DataType 'Int32))))) +(let testCallableType (CallableType '() '(testType))) +(let testBody (lambda '() (Variant (Int32 '0) 'X testType))) +(let testCallable (Callable testCallableType testBody)) +(let test (Apply testCallable)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.yql new file mode 100644 index 0000000000..f40ab1d5d8 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTargetTypeMismatchFail.yql @@ -0,0 +1,22 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32))))) +(let orig (Variant (Int32 '0) 'B origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Float)) '('C (DataType 'Int32))))) +(let testCallableType (CallableType '() '(testType))) +(let testBody (lambda '() (Variant (Float '0) 'B testType))) +(let testCallable (Callable testCallableType testBody)) +(let test (Apply testCallable)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.yql new file mode 100644 index 0000000000..aa0ab07e67 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverStructTypeMismatchFail.yql @@ -0,0 +1,22 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32))))) +(let orig (Variant (Int32 '0) 'B origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Float))))) +(let testCallableType (CallableType '() '(testType))) +(let testBody (lambda '() (Variant (Int32 '0) 'B testType))) +(let testCallable (Callable testCallableType testBody)) +(let test (Apply testCallable)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.yql new file mode 100644 index 0000000000..5c9d947981 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleExtraItemsFail.yql @@ -0,0 +1,22 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let orig (Variant (Int32 '0) '1 origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let testCallableType (CallableType '() '(testType))) +(let testBody (lambda '() (Variant (Int32 '0) '1 testType))) +(let testCallable (Callable testCallableType testBody)) +(let test (Apply testCallable)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.yql new file mode 100644 index 0000000000..2ececbce27 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleNotEnoughItemsFail.yql @@ -0,0 +1,22 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let orig (Variant (Int32 '0) '1 origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let testCallableType (CallableType '() '(testType))) +(let testBody (lambda '() (Variant (Int32 '0) '1 testType))) +(let testCallable (Callable testCallableType testBody)) +(let test (Apply testCallable)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.yql new file mode 100644 index 0000000000..21c992bea5 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTargetTypeMismatchFail.yql @@ -0,0 +1,22 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let orig (Variant (Int32 '0) '1 origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Float) (DataType 'Int32)))) +(let testCallableType (CallableType '() '(testType))) +(let testBody (lambda '() (Variant (Float '0) '1 testType))) +(let testCallable (Callable testCallableType testBody)) +(let test (Apply testCallable)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.yql new file mode 100644 index 0000000000..be762d2421 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantOverTupleTypeMismatchFail.yql @@ -0,0 +1,22 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let orig (Variant (Int32 '0) '1 origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Float)))) +(let testCallableType (CallableType '() '(testType))) +(let testBody (lambda '() (Variant (Int32 '0) '1 testType))) +(let testCallable (Callable testCallableType testBody)) +(let test (Apply testCallable)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.cfg new file mode 100644 index 0000000000..eb2e5315d1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.cfg @@ -0,0 +1 @@ +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.yql b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.yql new file mode 100644 index 0000000000..01a658c16e --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/VariantUnderlyingTypeMismatchFail.yql @@ -0,0 +1,22 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) +(let res_sink (DataSink 'result)) + +(let origType (VariantType (StructType '('A (DataType 'Int32)) '('B (DataType 'Int32)) '('C (DataType 'Int32))))) +(let orig (Variant (Int32 '0) 'B origType)) + +(let testcase (AsList orig)) + +(let testType (VariantType (TupleType (DataType 'Int32) (DataType 'Int32) (DataType 'Int32)))) +(let testCallableType (CallableType '() '(testType))) +(let testBody (lambda '() (Variant (Int32 '0) '1 testType))) +(let testCallable (Callable testCallableType testBody)) +(let test (Apply testCallable)) + +(let testcase (Append testcase test)) + +(let world (Write! world res_sink (Key) testcase '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/ImplictCasts/default.cfg b/yql/essentials/tests/s-expressions/suites/ImplictCasts/default.cfg new file mode 100644 index 0000000000..00dec6c3f8 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/ImplictCasts/default.cfg @@ -0,0 +1 @@ +res result.txt |