diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-11-20 11:14:58 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-11-20 11:14:58 +0000 |
commit | 31773f157bf8164364649b5f470f52dece0a4317 (patch) | |
tree | 33d0f7eef45303ab68cf08ab381ce5e5e36c5240 /yql/essentials/tests/s-expressions/suites/Result | |
parent | 2c7938962d8689e175574fc1e817c05049f27905 (diff) | |
parent | eff600952d5dfe17942f38f510a8ac2b203bb3a5 (diff) | |
download | ydb-31773f157bf8164364649b5f470f52dece0a4317.tar.gz |
Merge branch 'rightlib' into mergelibs-241120-1113
Diffstat (limited to 'yql/essentials/tests/s-expressions/suites/Result')
61 files changed, 878 insertions, 0 deletions
diff --git a/yql/essentials/tests/s-expressions/suites/Result/AfterTransform.yql b/yql/essentials/tests/s-expressions/suites/Result/AfterTransform.yql new file mode 100644 index 0000000000..f0514c97b1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/AfterTransform.yql @@ -0,0 +1,13 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let tresh (String '100)) +(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh)))) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1low '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/Apply.yql b/yql/essentials/tests/s-expressions/suites/Result/Apply.yql new file mode 100644 index 0000000000..ee940f6d93 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/Apply.yql @@ -0,0 +1,26 @@ +( +#comment +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let f1 (lambda '(x y) (block '( + (return (+ x y)) +)))) + +(let f2 (lambda '(x) (block '( + (return (Apply f1 x (Uint64 '2))) +)))) + +(let writer (lambda '(world data) (block '( + (let world (Write! world res_sink (Key) data '())) + (let world (Commit! world res_sink)) + (return world) +)))) + +(let data1 (Apply f2 (Uint64 '3))) +(let data2 (Apply f2 (Uint64 '4))) +(let world (Apply writer world data1)) +(let world (Apply writer world data2)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/AutoRefBig.yql b/yql/essentials/tests/s-expressions/suites/Result/AutoRefBig.yql new file mode 100644 index 0000000000..d54b9c6ce3 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/AutoRefBig.yql @@ -0,0 +1,13 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let tresh (String '100)) +(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh)))) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1low '('('take '1) '('autoref)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/AutoRefSmall.yql b/yql/essentials/tests/s-expressions/suites/Result/AutoRefSmall.yql new file mode 100644 index 0000000000..6c7ca6eabd --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/AutoRefSmall.yql @@ -0,0 +1,13 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let tresh (String '100)) +(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh)))) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1low '('('autoref)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/AutoRefTwoTables.yql b/yql/essentials/tests/s-expressions/suites/Result/AutoRefTwoTables.yql new file mode 100644 index 0000000000..f4c7304639 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/AutoRefTwoTables.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source '((Key '('table (String 'Input))) (Key '('table (String 'Input)))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1 '('('take '1) '('autoref)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/Empty.yql b/yql/essentials/tests/s-expressions/suites/Result/Empty.yql new file mode 100644 index 0000000000..3a0cc2e5e5 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/Empty.yql @@ -0,0 +1,3 @@ +( +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/LastInTempTable.yql b/yql/essentials/tests/s-expressions/suites/Result/LastInTempTable.yql new file mode 100644 index 0000000000..29dc7a9481 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/LastInTempTable.yql @@ -0,0 +1,14 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let tresh (String '100)) +(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh)))) +(let res_sink (DataSink 'result)) +(let data (Skip table1low (- (Max (Uint64 '1) (Length table1low)) (Uint64 '1)))) +(let world (Write! world res_sink (Key) data '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/LengthOfTable.yql b/yql/essentials/tests/s-expressions/suites/Result/LengthOfTable.yql new file mode 100644 index 0000000000..c6c4df1772 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/LengthOfTable.yql @@ -0,0 +1,12 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) + +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) (Length table1) '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/LengthOfTempTable.yql b/yql/essentials/tests/s-expressions/suites/Result/LengthOfTempTable.yql new file mode 100644 index 0000000000..34a926b1dc --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/LengthOfTempTable.yql @@ -0,0 +1,20 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let tresh (Int32 'x"64000000")) +(let table1low (FlatMap table1 (lambda '(item) (block '( + (let intValueOpt (FromString (Member item 'key) 'Int32)) + (let ret (FlatMap intValueOpt (lambda '(item2) (block '( + (return (ListIf (< item2 tresh) item)) + ))))) + (return ret) +))))) + +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) (Length table1low) '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/ListTakeOption.yql b/yql/essentials/tests/s-expressions/suites/Result/ListTakeOption.yql new file mode 100644 index 0000000000..215ec6bf79 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/ListTakeOption.yql @@ -0,0 +1,11 @@ +( +#comment +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (AsList (Uint32 '3) (Uint32 '5) (Uint32 '7) (Uint32 '10))) +(let world (Write! world res_sink (Key) data '('('take '2)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PagedTable.yql b/yql/essentials/tests/s-expressions/suites/Result/PagedTable.yql new file mode 100644 index 0000000000..1a7772c21f --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PagedTable.yql @@ -0,0 +1,13 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let table1 (Skip table1 (Uint64 '1))) +(let table1 (Take table1 (Uint64 '2))) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1 '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/ParseType.yql b/yql/essentials/tests/s-expressions/suites/Result/ParseType.yql new file mode 100644 index 0000000000..13c3e97d5b --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/ParseType.yql @@ -0,0 +1,11 @@ +( +#comment +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let t (ParseType '"(List<Int32?>,Struct<'b':Dict<Int32,Double>,'a':Int32>)->Tuple<String,Uint64>")) +(let world (Write! world res_sink (Key) (FormatType t) '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/Pickle.yql b/yql/essentials/tests/s-expressions/suites/Result/Pickle.yql new file mode 100644 index 0000000000..ff6b2d9159 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/Pickle.yql @@ -0,0 +1,57 @@ +( +#comment +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let vt1 (VariantType (TupleType (DataType 'Int32) (DataType 'String)))) +(let vt2 (VariantType (StructType '('x (DataType 'Int32)) '('y (DataType 'String))))) + +(let res_sink (DataSink 'result)) +(let data '( +(Uint32 '1) +(Int32 '-2) +(Uint64 '3) +(Int64 '-4) +(Double '-5) +(Float '-6) +(Bool 'true) +(Yson '@@[1u;"3"]@@) +(Json '@@{"id":1}@@) +(Date '11) +(Datetime '12) +(Timestamp '13) +(Interval '-13) +(Uint8 '14) +(Int8 '-15) +(Uint16 '16) +(Int16 '-17) +(TzDate '"18,Europe/Moscow") +(TzDate '"19,America/Los_Angeles") +(TzDatetime '"20,Etc/GMT-1") +(TzDatetime '"4291747199,Europe/Moscow") +(TzDatetime '"4291747198,America/Los_Angeles") +(TzTimestamp '"21,Etc/GMT+1") +(Cast (Datetime '"1262347200") 'String) +(TzDatetime '"1262347200,Europe/Moscow") +(Cast (Datetime '"1277985600") 'String) +(TzDatetime '"1277985600,Europe/Moscow") +(Uuid '"0123456789abcdef") +(AsStruct '('k (String 'key)) '('v (Uint64 '456))) +(AsList (Uint32 '2)) +(Just (Uint32 '3)) +(Nothing (OptionalType (DataType 'String))) +(ToDict (AsList '((String 'dkey1) (String 'dvalue1)) '((String 'dkey2) (String 'dvalue2))) + (lambda '(x) (Nth x '0)) (lambda '(x) (Nth x '1)) '('Sorted 'One) +) +(Void) +(Variant (Int32 '7) '0 vt1) +(Variant (String 'qwe) 'y vt2) +)) +(let save (Pickle data)) +(let data2 (Unpickle (TypeOf data) save)) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Write! world res_sink (Key) save '('('type)))) +(let world (Write! world res_sink (Key) data2 '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullColumns.yql b/yql/essentials/tests/s-expressions/suites/Result/PullColumns.yql new file mode 100644 index 0000000000..110fdcc060 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullColumns.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1 '('('columns '('value 'subkey)) '('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullColumnsFiltered.yql b/yql/essentials/tests/s-expressions/suites/Result/PullColumnsFiltered.yql new file mode 100644 index 0000000000..01484b19ae --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullColumnsFiltered.yql @@ -0,0 +1,12 @@ +( +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'value) '())) +(let world (Left! x)) +(let table (Right! x)) +(let res_sink (DataSink 'result)) +(let mr_sink (DataSink 'yt 'plato)) +(let world (Write! world res_sink (Key) table '('('type) '('ref) '('columns '('value 'key))))) +(let world (Commit! world mr_sink)) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullDict.cfg b/yql/essentials/tests/s-expressions/suites/Result/PullDict.cfg new file mode 100644 index 0000000000..8a0f058a3b --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullDict.cfg @@ -0,0 +1,2 @@ +in Input dict.txt +res result.txt diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullDict.yql b/yql/essentials/tests/s-expressions/suites/Result/PullDict.yql new file mode 100644 index 0000000000..c3b00f1716 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullDict.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1 '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.cfg b/yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.cfg new file mode 100644 index 0000000000..d1391bb33f --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.cfg @@ -0,0 +1,2 @@ +in Input struct.txt +res result.txt diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.yql b/yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.yql new file mode 100644 index 0000000000..b4e64a1d6d --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullDictAsStruct.yql @@ -0,0 +1,12 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let table1 (FlatMap table1 (lambda '(x) (AsList x x)))) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1 '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullKeyOnly.yql b/yql/essentials/tests/s-expressions/suites/Result/PullKeyOnly.yql new file mode 100644 index 0000000000..a71800ecf9 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullKeyOnly.yql @@ -0,0 +1,11 @@ +( +(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) '('key) '())) +(let world (Left! x)) +(let data (Right! x)) +(let result_sink (DataSink 'result)) +(let world (Write! world result_sink (Key) data '('('type) '('autoref)))) +(let plato_sink (DataSink 'yt 'plato)) +(let world (Commit! world plato_sink)) +(let world (Commit! world result_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullNumbers.yql b/yql/essentials/tests/s-expressions/suites/Result/PullNumbers.yql new file mode 100644 index 0000000000..8684754149 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullNumbers.yql @@ -0,0 +1,30 @@ +# do not check tmp here (YQL-130, YQL-131) +( +(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) (Void) '())) +(let world (Left! x)) +(let yt.plato.Input (Right! x)) +(let select1_input3 yt.plato.Input) +(let output5 (block '( + (let select1_output select1_input3) + (let select1_output (Map select1_output (lambda '(row) (block '( + (let res (Struct)) + (let res (AddMember res 'x (Int64 '1))) + (return res) +) +)))) + (let select1_output (Sort select1_output (Bool 'false) (lambda '(row) (block '( + (let res (Member row 'x)) + (return res) +) +)))) + (let select1_output (Take select1_output (Uint64 '2))) + (return select1_output) +) +)) +(let result_sink (DataSink 'result)) +(let world (Write! world result_sink (Key) output5 '('('type) '('autoref)))) +(let plato_sink (DataSink 'yt 'plato)) +(let world (Commit! world plato_sink)) +(let world (Commit! world result_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullOverExactLimit.yql b/yql/essentials/tests/s-expressions/suites/Result/PullOverExactLimit.yql new file mode 100644 index 0000000000..353d36313c --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullOverExactLimit.yql @@ -0,0 +1,12 @@ +( +(let result_sink (DataSink 'result)) +(let plato_sink (DataSink 'yt 'plato)) + +(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) (Void) '())) +(let world (Left! x)) +(let data (Take (Right! x) (Uint64 '3))) +(let world (Write! world result_sink (Key) data '('('type) '('autoref) '('take '3)))) +(let world (Commit! world plato_sink)) +(let world (Commit! world result_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullOverLimit.yql b/yql/essentials/tests/s-expressions/suites/Result/PullOverLimit.yql new file mode 100644 index 0000000000..4b7f4fc30c --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullOverLimit.yql @@ -0,0 +1,11 @@ +( +(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) (Void) '())) +(let world (Left! x)) +(let data (Take (Right! x) (Uint64 '3))) +(let result_sink (DataSink 'result)) +(let world (Write! world result_sink (Key) data '('('type) '('autoref) '('take '2)))) +(let plato_sink (DataSink 'yt 'plato)) +(let world (Commit! world plato_sink)) +(let world (Commit! world result_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.cfg b/yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.cfg new file mode 100644 index 0000000000..068d78205f --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.cfg @@ -0,0 +1,2 @@ +in Input def_values.txt +res result.txt diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.yql b/yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.yql new file mode 100644 index 0000000000..69f204a707 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullWithDefValues.yql @@ -0,0 +1,11 @@ +( +(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) (Void) '('('infer_scheme)))) +(let world (Left! x)) +(let data (Take (Right! x) (Uint64 '3))) +(let result_sink (DataSink 'result)) +(let world (Write! world result_sink (Key) data '('('type) '('autoref) '('take '2)))) +(let plato_sink (DataSink 'yt 'plato)) +(let world (Commit! world plato_sink)) +(let world (Commit! world result_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullWithDirectRead.yql b/yql/essentials/tests/s-expressions/suites/Result/PullWithDirectRead.yql new file mode 100644 index 0000000000..6c4b1851e0 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullWithDirectRead.yql @@ -0,0 +1,11 @@ +( +(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) (Void) '('('direct_read)))) +(let world (Left! x)) +(let data (Take (Right! x) (Uint64 '3))) +(let result_sink (DataSink 'result)) +(let world (Write! world result_sink (Key) data '('('type) '('autoref) '('take '2)))) +(let plato_sink (DataSink 'yt 'plato)) +(let world (Commit! world plato_sink)) +(let world (Commit! world result_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.cfg b/yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.cfg new file mode 100644 index 0000000000..94fcaf1f6f --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.cfg @@ -0,0 +1,2 @@ +in Input infer_scheme.txt +res result.txt diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.yql b/yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.yql new file mode 100644 index 0000000000..69f204a707 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullWithInferScheme.yql @@ -0,0 +1,11 @@ +( +(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) (Void) '('('infer_scheme)))) +(let world (Left! x)) +(let data (Take (Right! x) (Uint64 '3))) +(let result_sink (DataSink 'result)) +(let world (Write! world result_sink (Key) data '('('type) '('autoref) '('take '2)))) +(let plato_sink (DataSink 'yt 'plato)) +(let world (Commit! world plato_sink)) +(let world (Commit! world result_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullYson.cfg b/yql/essentials/tests/s-expressions/suites/Result/PullYson.cfg new file mode 100644 index 0000000000..e25ff9f9ff --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullYson.cfg @@ -0,0 +1,2 @@ +in Input yson.txt +res result.txt diff --git a/yql/essentials/tests/s-expressions/suites/Result/PullYson.yql b/yql/essentials/tests/s-expressions/suites/Result/PullYson.yql new file mode 100644 index 0000000000..c3b00f1716 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PullYson.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1 '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/Pure.yql b/yql/essentials/tests/s-expressions/suites/Result/Pure.yql new file mode 100644 index 0000000000..9ad249ecf2 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/Pure.yql @@ -0,0 +1,52 @@ +( +#comment +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let vt1 (VariantType (TupleType (DataType 'Int32) (DataType 'String)))) +(let vt2 (VariantType (StructType '('x (DataType 'Int32)) '('y (DataType 'String))))) +(let res_sink (DataSink 'result)) +(let data '( +(Uint32 '1) +(Int32 '-2) +(Uint64 '3) +(Int64 '-4) +(Double '-5) +(Float '-6) +(Bool 'true) +(Yson '@@[1u;"3"]@@) +(Json '@@{"id":1}@@) +(Date '11) +(Datetime '12) +(Timestamp '13) +(Interval '-13) +(Uint8 '14) +(Int8 '-15) +(Uint16 '16) +(Int16 '-17) +(TzDate '"18,Europe/Moscow") +(TzDate '"19,America/Los_Angeles") +(TzDatetime '"20,Etc/GMT-1") +(TzDatetime '"4291747199,Europe/Moscow") +(TzDatetime '"4291747198,America/Los_Angeles") +(TzTimestamp '"21,Etc/GMT+1") +(Cast (Datetime '"1262347200") 'String) +(TzDatetime '"1262347200,Europe/Moscow") +(Cast (Datetime '"1277985600") 'String) +(TzDatetime '"1277985600,Europe/Moscow") +(Uuid '"0123456789abcdef") +(AsStruct '('k (String 'key)) '('v (Uint64 '456))) +(AsList (Uint32 '2)) +(Just (Uint32 '3)) +(Nothing (OptionalType (DataType 'String))) +(ToDict (AsList '((String 'dkey1) (String 'dvalue1)) '((String 'dkey2) (String 'dvalue2))) + (lambda '(x) (Nth x '0)) (lambda '(x) (Nth x '1)) '('Sorted 'One) +) +(Void) +(Variant (Int32 '7) '0 vt1) +(Variant (String 'qwe) 'y vt2) +)) +(let world (Write! world res_sink (Key) data '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/PureWithType.yql b/yql/essentials/tests/s-expressions/suites/Result/PureWithType.yql new file mode 100644 index 0000000000..9fdf74cfdf --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/PureWithType.yql @@ -0,0 +1,21 @@ +( +#comment +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data '( +(Uint32 '1) +(AsStruct '('k (String 'key)) '('v (Uint64 '456))) +(AsList (Uint32 '2)) +(Just (Uint32 '3)) +(Nothing (OptionalType (DataType 'String))) +(ToDict (AsList '((String 'dkey1) (String 'dvalue1)) '((String 'dkey2) (String 'dvalue2))) + (lambda '(x) (Nth x '0)) (lambda '(x) (Nth x '1)) '('Sorted 'One) +) +(Void) +)) +(let world (Write! world res_sink (Key) data '('('type)))) +(let world (Commit! world res_sink)) +(return world) +)
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/Result/ReadAllFields.yql b/yql/essentials/tests/s-expressions/suites/Result/ReadAllFields.yql new file mode 100644 index 0000000000..77573dbc12 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/ReadAllFields.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) (Void) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1 '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/Resource.yql b/yql/essentials/tests/s-expressions/suites/Result/Resource.yql new file mode 100644 index 0000000000..97aa87cca3 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/Resource.yql @@ -0,0 +1,17 @@ +( +#comment +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let gen (NewMTRand (Uint64 '42))) +(let p (NextMTRand gen)) +(let gen (Nth p '1)) +(let v1 (Nth p '0)) +(let p (NextMTRand gen)) +(let gen (Nth p '1)) +(let v2 (Nth p '0)) +(let world (Write! world res_sink (Key) '(v1 v2) '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/ResultColumns.yql b/yql/essentials/tests/s-expressions/suites/Result/ResultColumns.yql new file mode 100644 index 0000000000..cf2253c9bc --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/ResultColumns.yql @@ -0,0 +1,13 @@ +( +#comment +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let row1 (AsStruct '('key (String 'key1)) '('subkey (String '.)) '('value (String 'value1)))) +(let row2 (AsStruct '('key (String 'key2)) '('subkey (String '.)) '('value (String 'value2)))) +(let table1 (AsList row1 row2)) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1 '('('columns '('value 'subkey 'key)) '('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/ResultColumnsPrefixes.yql b/yql/essentials/tests/s-expressions/suites/Result/ResultColumnsPrefixes.yql new file mode 100644 index 0000000000..5be6c09045 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/ResultColumnsPrefixes.yql @@ -0,0 +1,13 @@ +( +#comment +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let row1 (AsStruct '('key1 (String 'key1)) '('key2 (String '.)) '('aaa (String 'value1)))) +(let row2 (AsStruct '('key1 (String 'key2)) '('key2 (String '.)) '('aaa (String 'value2)))) +(let table1 (AsList row1 row2)) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1 '('('columns '('('prefix 'key) 'aaa)) '('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/SeveralWritesAndCommits.yql b/yql/essentials/tests/s-expressions/suites/Result/SeveralWritesAndCommits.yql new file mode 100644 index 0000000000..4780768ff4 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/SeveralWritesAndCommits.yql @@ -0,0 +1,15 @@ +( +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) (Int32 '1) '())) +(let world (Write! world res_sink (Key) (Int32 '2) '())) +(let world (Write! world res_sink (Key) (Int32 '3) '())) +(let world (Commit! world res_sink)) +(let world (Write! world res_sink (Key) (Int32 '4) '())) +(let world (Write! world res_sink (Key) (Int32 '5) '())) +(let world (Write! world res_sink (Key) (Int32 '6) '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/SimpleWrite.yql b/yql/essentials/tests/s-expressions/suites/Result/SimpleWrite.yql new file mode 100644 index 0000000000..d91538e365 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/SimpleWrite.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1 '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/SimpleWriteByRef.yql b/yql/essentials/tests/s-expressions/suites/Result/SimpleWriteByRef.yql new file mode 100644 index 0000000000..b8fd35ae40 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/SimpleWriteByRef.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) table1 '('('ref)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/SkipTableByTempTableLength.yql b/yql/essentials/tests/s-expressions/suites/Result/SkipTableByTempTableLength.yql new file mode 100644 index 0000000000..2924cf4e00 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/SkipTableByTempTableLength.yql @@ -0,0 +1,14 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let tresh (String '100)) +(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh)))) +(let res_sink (DataSink 'result)) +(let data (Skip table1 (- (Max (Uint64 '1) (Length table1low)) (Uint64 '1)))) +(let world (Write! world res_sink (Key) data '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/TableScheme.cfg b/yql/essentials/tests/s-expressions/suites/Result/TableScheme.cfg new file mode 100644 index 0000000000..94fcaf1f6f --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/TableScheme.cfg @@ -0,0 +1,2 @@ +in Input infer_scheme.txt +res result.txt diff --git a/yql/essentials/tests/s-expressions/suites/Result/TableScheme.yql b/yql/essentials/tests/s-expressions/suites/Result/TableScheme.yql new file mode 100644 index 0000000000..e4180b783f --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/TableScheme.yql @@ -0,0 +1,16 @@ +( +(let mr_source (DataSource 'yt 'plato)) + +(let x (Read! world mr_source + (Key '('tablescheme (String 'Input))) + (Void) '('('infer_scheme)) +)) + +(let world (Left! x)) +(let scheme (Right! x)) + +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) scheme '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/TableSchemeNotFail.yql b/yql/essentials/tests/s-expressions/suites/Result/TableSchemeNotFail.yql new file mode 100644 index 0000000000..729098839b --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/TableSchemeNotFail.yql @@ -0,0 +1,18 @@ +( +(let mr_source (DataSource 'yt 'plato)) + +(let x (Read! world mr_source + (Key '('tablescheme (String 'Input))) + (Void) '( + '('do_not_fail_on_invalid_schema) + ) +)) + +(let world (Left! x)) +(let scheme (Right! x)) + +(let res_sink (DataSink 'result)) +(let world (Write! world res_sink (Key) scheme '('('type)))) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/TypeOf.yql b/yql/essentials/tests/s-expressions/suites/Result/TypeOf.yql new file mode 100644 index 0000000000..66bf82a11d --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/TypeOf.yql @@ -0,0 +1,23 @@ +( +#comment +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let vt1 (VariantType (TupleType (DataType 'Int32) (DataType 'String)))) +(let vt2 (VariantType (StructType '('x (DataType 'Int32)) '('y (DataType 'String))))) +(let res_sink (DataSink 'result)) +(let data '( +(Uint32 '1) +(AsStruct '('k (String 'key)) '('v (Uint64 '456))) +(AsList (Uint32 '2)) +(Just (Uint32 '3)) +(Nothing (OptionalType (DataType 'String))) +(AsDict '((String 'dkey1) (String 'dvalue1)) '((String 'dkey2) (String 'dvalue2))) +(Variant (Int32 '7) '0 vt1) +(Variant (String 'qwe) 'y vt2) +)) +(let world (Write! world res_sink (Key) (FormatType (TypeOf data)) '())) +(let world (Write! world res_sink (Key) (FormatType (TypeOf (TypeOf data))) '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/TypeReflection.yql b/yql/essentials/tests/s-expressions/suites/Result/TypeReflection.yql new file mode 100644 index 0000000000..c5def78d58 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/TypeReflection.yql @@ -0,0 +1,29 @@ +( +#comment +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let x (Uint32 '1)) +(let y (String 'asd)) +(let o (Just x)) +(let l (AsList x)) +(let d (AsDict '(x y))) +(let t '(x y)) +(let s (AsStruct '('a x) '('b y))) +(let vt1 (VariantType (TupleType (DataType 'Int32) (DataType 'String)))) +(let vt2 (VariantType (StructType '('x (DataType 'Int32)) '('y (DataType 'String))))) +(let world (Write! world res_sink (Key) (FormatType (OptionalItemType (TypeOf o))) '())) +(let world (Write! world res_sink (Key) (FormatType (ListItemType (TypeOf l))) '())) +(let world (Write! world res_sink (Key) (FormatType (DictKeyType (TypeOf d))) '())) +(let world (Write! world res_sink (Key) (FormatType (DictPayloadType (TypeOf d))) '())) +(let world (Write! world res_sink (Key) (FormatType (TupleElementType (TypeOf t) '0)) '())) +(let world (Write! world res_sink (Key) (FormatType (TupleElementType (TypeOf t) '1)) '())) +(let world (Write! world res_sink (Key) (FormatType (StructMemberType (TypeOf s) 'a)) '())) +(let world (Write! world res_sink (Key) (FormatType (StructMemberType (TypeOf s) 'b)) '())) +(let world (Write! world res_sink (Key) (FormatType (VariantUnderlyingType vt1)) '())) +(let world (Write! world res_sink (Key) (FormatType (VariantUnderlyingType vt2)) '())) +(let world (Write! world res_sink (Key) (FormatType (StreamItemType (StreamType (DataType 'String)))) '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/TypeStructs.yql b/yql/essentials/tests/s-expressions/suites/Result/TypeStructs.yql new file mode 100644 index 0000000000..5b80134b73 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/TypeStructs.yql @@ -0,0 +1,16 @@ +( +#comment +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let s1 (AsStruct '('a (Uint32 '1)) '('b (String 'qwe)))) +(let s2 (AsStruct '('c (Uint32 '1)) '('d (Just (String 'asd))))) +(let world (Write! world res_sink (Key) (FormatType (AddMemberType (TypeOf s1) 'q (DataType 'Double))) '())) +(let world (Write! world res_sink (Key) (FormatType (RemoveMemberType (TypeOf s1) 'a)) '())) +(let world (Write! world res_sink (Key) (FormatType (ForceRemoveMemberType (TypeOf s1) 'q)) '())) +(let world (Write! world res_sink (Key) (FormatType (FlattenMembersType '('"p." (TypeOf s1)) '('"q." (TypeOf s2)))) '())) +(let world (Write! world res_sink (Key) (FormatType (FlattenMembersType '('"p." (TypeOf s1)) '('"q." (OptionalType (TypeOf s2))))) '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/WorldIf.yql b/yql/essentials/tests/s-expressions/suites/Result/WorldIf.yql new file mode 100644 index 0000000000..a634dbecb2 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/WorldIf.yql @@ -0,0 +1,26 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input))) '('key 'subkey 'value) '())) +(let world (Left! x)) +(let table1 (Right! x)) +(let tresh (String '100)) +(let table1low (Filter table1 (lambda '(item) (< (Member item 'key) tresh)))) +(let res_sink (DataSink 'result)) + +(let world (Write! world res_sink (Key) (String '1) '())) +(let world (If! world (Bool 'false) (Write! world res_sink (Key) table1low '()) world)) +(let world (Commit! world res_sink)) + +(let world (Write! world res_sink (Key) (String '2) '())) +(let world (If! world (Bool 'true) (Write! world res_sink (Key) table1low '()) world)) +(let world (Commit! world res_sink)) + +(let world (Write! world res_sink (Key) (String '3) '())) +(let world (If! world (<= (Length table1low) (Uint64 '1)) + (Write! world res_sink (Key) table1low '()) + (Write! world res_sink (Key) table1 '()))) +(let world (Commit! world res_sink)) + +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/Yson.yql b/yql/essentials/tests/s-expressions/suites/Result/Yson.yql new file mode 100644 index 0000000000..f978241cfc --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/Yson.yql @@ -0,0 +1,21 @@ +( +#comment +(let config (DataSource 'config)) +(let world (Configure! world config 'PureDataSource 'yt)) + +(let res_sink (DataSink 'result)) +(let data (Yson '@@ +{ +"a"=1; +"$b"=#; +"c"=2u; +"d"=4.1; +"e"=%true; +"f"=[1;<x=1>"english text"]; +"g"=<u=2>{x=<v="\xff\xff binary">[];y="русский текст"}; +} +@@)) +(let world (Write! world res_sink (Key) data '())) +(let world (Commit! world res_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/Result/def_values.txt b/yql/essentials/tests/s-expressions/suites/Result/def_values.txt new file mode 100644 index 0000000000..5a5fca5c32 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/def_values.txt @@ -0,0 +1,2 @@ +{"key"="1";value="3"}; +{"key"="2";value="4";"subkey"="123"}; diff --git a/yql/essentials/tests/s-expressions/suites/Result/def_values.txt.attr b/yql/essentials/tests/s-expressions/suites/Result/def_values.txt.attr new file mode 100644 index 0000000000..de393c2dc7 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/def_values.txt.attr @@ -0,0 +1,15 @@ +{ + "_yql_row_spec"={ + "Type"=["StructType";[ + ["key";["DataType";"String"]]; + ["subkey";["DataType";"String"]]; + ["value";["DataType";"String"]]; + ]]; + "DefaultValues"={"key"="\"\"";"subkey"="\"\"";"value"="\"\"";}; + }; + "schema"=<"strict" = %true> [ + {"type"="string"; "name"="key"}; + {"type"="string"; "name"="subkey"}; + {"type"="string"; "name"="value"} + ] +} diff --git a/yql/essentials/tests/s-expressions/suites/Result/default.cfg b/yql/essentials/tests/s-expressions/suites/Result/default.cfg new file mode 100644 index 0000000000..fe2b19a9ff --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/default.cfg @@ -0,0 +1,3 @@ +in Input input.txt +out Output output.txt +res result.txt diff --git a/yql/essentials/tests/s-expressions/suites/Result/dict.txt b/yql/essentials/tests/s-expressions/suites/Result/dict.txt new file mode 100644 index 0000000000..c189e76627 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/dict.txt @@ -0,0 +1,6 @@ +{"key"="075";"subkey"="1";"value"={"b"=11;"a"=1;}}; +{"key"="800";"subkey"="2";"value"={"a"=2;}}; +{"key"="020";"subkey"="3";"value"={}}; +{"key"="150";"subkey"="4";"value"={"b"=13;"a"=4;}}; +{"key"="075";"subkey"="5";"value"={"b"=14;"a"=5;}}; +{"key"="100";"subkey"="6";"value"={"c"=15;"a"=6;}}; diff --git a/yql/essentials/tests/s-expressions/suites/Result/dict.txt.attr b/yql/essentials/tests/s-expressions/suites/Result/dict.txt.attr new file mode 100644 index 0000000000..6dd8d28db1 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/dict.txt.attr @@ -0,0 +1,27 @@ +{ + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + ["DictType"; ["DataType";"String"]; ["DataType";"Int32"];] + ] + ] + ] + } +}
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt b/yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt new file mode 100644 index 0000000000..eff01d5cf2 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt @@ -0,0 +1,4 @@ +{"key"="075";"subkey"="1";"value"="abc"}; +{"key"="800";"subkey"="2";"value"="ddd";"extra"=1u}; +{"key"="020";"subkey"="3";"value"="q";"extra"=1u}; +{"key"="150";"subkey"="4";"value"="qzz";"extra"=1u}; diff --git a/yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt.attr b/yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt.attr new file mode 100644 index 0000000000..bbd3d58b0d --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/infer_scheme.txt.attr @@ -0,0 +1,7 @@ +{ + "infer_schema" = %true; + "schema_mode" = "strong"; + "schema" = <strict=%false>[ + {"type"="string"; "name"="key"}; + ] +}
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/Result/input.txt b/yql/essentials/tests/s-expressions/suites/Result/input.txt new file mode 100644 index 0000000000..65949ea745 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/input.txt @@ -0,0 +1,4 @@ +{"key"="075";"subkey"="1";"value"="abc"}; +{"key"="800";"subkey"="2";"value"="ddd"}; +{"key"="020";"subkey"="3";"value"="q"}; +{"key"="150";"subkey"="4";"value"="qzz"}; diff --git a/yql/essentials/tests/s-expressions/suites/Result/input.txt.attr b/yql/essentials/tests/s-expressions/suites/Result/input.txt.attr new file mode 100644 index 0000000000..b6100e5fd0 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/input.txt.attr @@ -0,0 +1,30 @@ +{ + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +}
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/Result/struct.txt b/yql/essentials/tests/s-expressions/suites/Result/struct.txt new file mode 100644 index 0000000000..c92d2d7733 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/struct.txt @@ -0,0 +1,6 @@ +{"key"="075";"subkey"="1";"value"={"b"=11u;"a"=1;}}; +{"key"="800";"subkey"="2";"value"={"a"=2;}}; +{"key"="020";"subkey"="3";"value"={"a"=7}}; +{"key"="150";"subkey"="4";"value"={"b"=13u;"a"=4;}}; +{"key"="075";"subkey"="5";"value"={"b"=14u;"a"=5;}}; +{"key"="100";"subkey"="6";"value"={"a"=6;"c"="foo"}}; diff --git a/yql/essentials/tests/s-expressions/suites/Result/struct.txt.attr b/yql/essentials/tests/s-expressions/suites/Result/struct.txt.attr new file mode 100644 index 0000000000..1b386b578c --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/struct.txt.attr @@ -0,0 +1,27 @@ +{ + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + ["StructType"; [["a";["DataType";"Int32"]]; ["b";["OptionalType";["DataType";"Uint32"];]]]] + ] + ] + ] + } +}
\ No newline at end of file diff --git a/yql/essentials/tests/s-expressions/suites/Result/yson.txt b/yql/essentials/tests/s-expressions/suites/Result/yson.txt new file mode 100644 index 0000000000..925448ce22 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/yson.txt @@ -0,0 +1,7 @@ +{"key"="075";"subkey"="1";"value"={"a"=1;}}; +{"key"="075";"subkey"="1";"value"={"$b"=#;}}; +{"key"="075";"subkey"="1";"value"={"c"=2u;}}; +{"key"="075";"subkey"="1";"value"={"d"=4.1;}}; +{"key"="075";"subkey"="1";"value"={"e"=%true;}}; +{"key"="075";"subkey"="1";"value"={"f"=[1;<x=1>"english text"]}}; +{"key"="100";"subkey"="6";"value"={"g"=<u=2>{x=<v="\xff\xff binary">[];y="русский текст"}}}; diff --git a/yql/essentials/tests/s-expressions/suites/Result/yson.txt.attr b/yql/essentials/tests/s-expressions/suites/Result/yson.txt.attr new file mode 100644 index 0000000000..0c28bda505 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/Result/yson.txt.attr @@ -0,0 +1,30 @@ +{ + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "Yson" + ] + ] + ] + ] + } +}
\ No newline at end of file |