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/View | |
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/View')
45 files changed, 654 insertions, 0 deletions
diff --git a/yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.cfg b/yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.cfg new file mode 100644 index 0000000000..2ac9312f92 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.cfg @@ -0,0 +1,4 @@ +in Input1 input.txt +in Input2 input6.txt +in InputView input_view.txt +res result.txt diff --git a/yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.yql b/yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.yql new file mode 100644 index 0000000000..5a2597e5cc --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/DoubleGlobViewRead.yql @@ -0,0 +1,32 @@ +( +(let mr_source (DataSource 'yt 'plato)) +(let mr_sink (DataSink 'yt 'plato)) +(let res_sink (DataSink 'result)) +(let source_any (DataSource 'yt '"$all")) + +(let world (Configure! world source_any '"Attr" '"inferschema" '"1")) +(let world (Configure! world source_any '"Attr" '"maxrowweight" '"128m")) + +(let x1 (Read! world mr_source (Key + '('table (String 'InputView)) +) (Void) '())) + +(let world (Left! x1)) +(let data (Right! x1)) + +(let world (Write! world res_sink (Key) data '())) +(let world (Commit! world res_sink)) + +(let x2 (Read! world mr_source (Key + '('table (String 'InputView)) +) (Void) '())) + +(let world (Left! x2)) +(let data (Right! x2)) + +(let world (Write! world res_sink (Key) data '())) +(let world (Commit! world res_sink)) + +(let world (Commit! world mr_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/View/DsvCount.cfg b/yql/essentials/tests/s-expressions/suites/View/DsvCount.cfg new file mode 100644 index 0000000000..db6c9d1b8c --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/DsvCount.cfg @@ -0,0 +1,4 @@ +in Input input3.txt +out Output output.txt +res result.txt +udf dsv_udf diff --git a/yql/essentials/tests/s-expressions/suites/View/DsvCount.yql b/yql/essentials/tests/s-expressions/suites/View/DsvCount.yql new file mode 100644 index 0000000000..3fa0a24d9b --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/DsvCount.yql @@ -0,0 +1,50 @@ +( +(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) '('dict) '())) +(let world (Left! x)) +(let Input (Right! x)) +(let select1_input11 Input) +(let output12 (block '( + (let select1_output select1_input11) + (let select1_output (Filter select1_output (lambda '(row) (block '( + (let res (Coalesce (!= (Not (Exists (Lookup (Member row 'dict) (String '"c")))) (Bool 'true)) (Bool 'false))) + (return res) +) +)))) + (let select1_output (PartitionByKey select1_output (lambda '(row) (block '( + (let res (String '"")) + (return res) +) +)) (Void) (Void) (lambda '(stream) (FlatMap stream (lambda '(pair) (block '( + (let key (Nth pair '0)) + (let group (ForwardList (Nth pair '1))) + (let aggr (Fold1 group (lambda '(row) (block '( + (let res (Struct)) + (let res (AddMember res 'Count7 (Convert (Exists (Unwrap (Lookup (Member row 'dict) (String '"a")))) 'Uint64))) + (return res) +) +)) (lambda '(row state) (block '( + (let res (Struct)) + (let res (AddMember res 'Count7 (OptionalReduce (Member state 'Count7) (Convert (Exists (Unwrap (Lookup (Member row 'dict) (String '"a")))) 'Uint64) (lambda '(a b) (+ a b))))) + (return res) +) +)))) + (let res (FlatMap aggr (lambda '(row) (block '( + (let res (Struct)) + (let res (AddMember res 'a_count (Member row 'Count7))) + (let res (AsList res)) + (return res) +) +)))) + (return res) +))))) +)) + (return select1_output) +) +)) +(let result_sink (DataSink 'result)) +(let world (Write! world result_sink (Key) output12 '('('type) '('autoref) '('columns '('a_count))))) +(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/View/DsvCountPartitionBy.cfg b/yql/essentials/tests/s-expressions/suites/View/DsvCountPartitionBy.cfg new file mode 100644 index 0000000000..db6c9d1b8c --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/DsvCountPartitionBy.cfg @@ -0,0 +1,4 @@ +in Input input3.txt +out Output output.txt +res result.txt +udf dsv_udf diff --git a/yql/essentials/tests/s-expressions/suites/View/DsvCountPartitionBy.yql b/yql/essentials/tests/s-expressions/suites/View/DsvCountPartitionBy.yql new file mode 100644 index 0000000000..f186cb7101 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/DsvCountPartitionBy.yql @@ -0,0 +1,53 @@ +( +(let x (Read! world (DataSource 'yt 'plato) (Key '('table (String 'Input))) '('dict 'key) '())) +(let world (Left! x)) +(let Input (Right! x)) +(let select1_input12 Input) +(let output13 (block '( + (let select1_output select1_input12) + (let select1_output (Filter select1_output (lambda '(row) (block '( + (let res (Coalesce (!= (Not (Exists (Lookup (Member row 'dict) (String '"b")))) (Bool 'true)) (Bool 'false))) + (return res) +) +)))) + (let select1_output (PartitionByKey select1_output (lambda '(row) (block '( + (let res (Member row 'key)) + (return res) +) +)) (Void) (Void) (lambda '(stream) (FlatMap stream (lambda '(pair) (block '( + (let key (Nth pair '0)) + (let group (ForwardList (Nth pair '1))) + (let aggr (Fold1 group (lambda '(row) (block '( + (let res (Struct)) + (let res (AddMember res 'key (Member row 'key))) + (let res (AddMember res 'Count7 (Convert (Exists (Lookup (Member row 'dict) (String '"a"))) 'Uint64))) + (return res) +) +)) (lambda '(row state) (block '( + (let res (Struct)) + (let res (AddMember res 'key (Member row 'key))) + (let res (AddMember res 'Count7 (OptionalReduce (Member state 'Count7) (Convert (Exists (Lookup (Member row 'dict) (String '"a"))) 'Uint64) (lambda '(a b) (+ a b))))) + (return res) +) +)))) + (let res (FlatMap aggr (lambda '(row) (block '( + (let res (Struct)) + (let res (AddMember res 'key (Member row 'key))) + (let res (AddMember res 'a (Member row 'Count7))) + (let res (AsList res)) + (return res) +) +)))) + (return res) +))) +)))) + (return select1_output) +) +)) +(let result_sink (DataSink 'result)) +(let world (Write! world result_sink (Key) output13 '('('type) '('autoref) '('columns '('key 'a))))) +(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/View/Key1AfterUdfData.cfg b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfData.cfg new file mode 100644 index 0000000000..44b1761859 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfData.cfg @@ -0,0 +1,4 @@ +in Input input2.txt +out Output output.txt +res result.txt +udf dummylog diff --git a/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfData.yql b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfData.yql new file mode 100644 index 0000000000..3574c04daf --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfData.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input)) '('view (String 'key1))) '('column0) '() ) ) +(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/View/Key1AfterUdfRawData.cfg b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfRawData.cfg new file mode 100644 index 0000000000..44b1761859 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfRawData.cfg @@ -0,0 +1,4 @@ +in Input input2.txt +out Output output.txt +res result.txt +udf dummylog diff --git a/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfRawData.yql b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfRawData.yql new file mode 100644 index 0000000000..7e579328e6 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfRawData.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input)) '('view (String 'key2))) '('column0) '() ) ) +(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/View/Key1AfterUdfScheme.cfg b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfScheme.cfg new file mode 100644 index 0000000000..44b1761859 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfScheme.cfg @@ -0,0 +1,4 @@ +in Input input2.txt +out Output output.txt +res result.txt +udf dummylog diff --git a/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfScheme.yql b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfScheme.yql new file mode 100644 index 0000000000..5d429021c3 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/Key1AfterUdfScheme.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('tablescheme (String 'Input)) '('view (String 'key1))) (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/View/Key1Data.yql b/yql/essentials/tests/s-expressions/suites/View/Key1Data.yql new file mode 100644 index 0000000000..85a3398e41 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/Key1Data.yql @@ -0,0 +1,16 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let source_any (DataSource 'yt '"$all")) + +(let world (Configure! world source_any '"Attr" '"inferschema" '"1")) +(let world (Configure! world source_any '"Attr" '"maxrowweight" '"128m")) + +(let x (Read! world mr_source (Key '('table (String 'Input)) '('view (String 'key1))) '('column0) '() ) ) +(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/View/Key1Scheme.yql b/yql/essentials/tests/s-expressions/suites/View/Key1Scheme.yql new file mode 100644 index 0000000000..5d429021c3 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/Key1Scheme.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('tablescheme (String 'Input)) '('view (String 'key1))) (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/View/MasterScheme.yql b/yql/essentials/tests/s-expressions/suites/View/MasterScheme.yql new file mode 100644 index 0000000000..0a9e55e5a5 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/MasterScheme.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('tablescheme (String 'Input))) (Void) '()) ) +(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/View/NoReadData.yql b/yql/essentials/tests/s-expressions/suites/View/NoReadData.yql new file mode 100644 index 0000000000..7e27b9b42a --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/NoReadData.yql @@ -0,0 +1,16 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let source_any (DataSource 'yt '"$all")) + +(let world (Configure! world source_any '"Attr" '"inferschema" '"1")) +(let world (Configure! world source_any '"Attr" '"maxrowweight" '"128m")) + +(let x (Read! world mr_source (Key '('table (String 'Input)) '('view (String 'noread))) '('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/View/NoReadScheme.yql b/yql/essentials/tests/s-expressions/suites/View/NoReadScheme.yql new file mode 100644 index 0000000000..b231e96834 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/NoReadScheme.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('tablescheme (String 'Input)) '('view (String 'noread))) (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/View/RawView.cfg b/yql/essentials/tests/s-expressions/suites/View/RawView.cfg new file mode 100644 index 0000000000..61289d7a17 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/RawView.cfg @@ -0,0 +1,4 @@ +in Input1 input2.txt +in Input2 input5.txt +res result.txt +udf dummylog diff --git a/yql/essentials/tests/s-expressions/suites/View/RawView.yql b/yql/essentials/tests/s-expressions/suites/View/RawView.yql new file mode 100644 index 0000000000..d23c50d85c --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/RawView.yql @@ -0,0 +1,40 @@ +( +(let mr_source (DataSource 'yt 'plato)) +(let res_sink (DataSink 'result)) +(let source_any (DataSource 'yt '"$all")) + +(let world (Configure! world source_any '"Attr" '"inferschema" '"1")) +(let world (Configure! world source_any '"Attr" '"maxrowweight" '"128m")) + +(let x (Read! world mr_source (Key + '('table (String 'Input1)) + '('view (String 'raw)) +) (Void) '())) + +(let world (Left! x)) +(let data (Right! x)) + +(let world (Write! world res_sink (Key) data '())) + +(let x (Read! world mr_source (Key + '('table (String 'Input1)) +) (Void) '())) + +(let world (Left! x)) +(let data (Right! x)) + +(let world (Write! world res_sink (Key) data '())) + +(let x (Read! world mr_source (Key + '('table (String 'Input2)) + '('view (String 'raw)) +) (Void) '())) + +(let world (Left! x)) +(let data (Right! x)) + +(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/View/ReadGlobView.cfg b/yql/essentials/tests/s-expressions/suites/View/ReadGlobView.cfg new file mode 100644 index 0000000000..2ac9312f92 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/ReadGlobView.cfg @@ -0,0 +1,4 @@ +in Input1 input.txt +in Input2 input6.txt +in InputView input_view.txt +res result.txt diff --git a/yql/essentials/tests/s-expressions/suites/View/ReadGlobView.yql b/yql/essentials/tests/s-expressions/suites/View/ReadGlobView.yql new file mode 100644 index 0000000000..8588e4df39 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/ReadGlobView.yql @@ -0,0 +1,21 @@ +( +(let mr_source (DataSource 'yt 'plato)) +(let mr_sink (DataSink 'yt 'plato)) +(let res_sink (DataSink 'result)) +(let source_any (DataSource 'yt '"$all")) + +(let world (Configure! world source_any '"Attr" '"inferschema" '"1")) +(let world (Configure! world source_any '"Attr" '"maxrowweight" '"128m")) + +(let x (Read! world mr_source (Key + '('table (String 'InputView)) +) (Void) '())) + +(let world (Left! x)) +(let data (Right! x)) + +(let world (Write! world res_sink (Key) data '())) +(let world (Commit! world res_sink)) +(let world (Commit! world mr_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.cfg b/yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.cfg new file mode 100644 index 0000000000..2ac9312f92 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.cfg @@ -0,0 +1,4 @@ +in Input1 input.txt +in Input2 input6.txt +in InputView input_view.txt +res result.txt diff --git a/yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.yql b/yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.yql new file mode 100644 index 0000000000..c90fdf788a --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/SchemeGlobView.yql @@ -0,0 +1,17 @@ +( +(let mr_source (DataSource 'yt 'plato)) +(let mr_sink (DataSink 'yt 'plato)) +(let res_sink (DataSink 'result)) + +(let x (Read! world mr_source (Key + '('tablescheme (String 'InputView)) +) (Void) '())) + +(let world (Left! x)) +(let data (Right! x)) + +(let world (Write! world res_sink (Key) data '())) +(let world (Commit! world res_sink)) +(let world (Commit! world mr_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.cfg b/yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.cfg new file mode 100644 index 0000000000..ad52c79527 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.cfg @@ -0,0 +1,2 @@ +in Input input.txt +out Output output.txt diff --git a/yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.yql b/yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.yql new file mode 100644 index 0000000000..f5eb0c356b --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/TrivialDataCopy.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('table (String 'Input)) '('view (String 'trivial))) '('value) '() ) ) +(let world (Left! x)) +(let table1 (Right! x)) +(let mr_sink (DataSink 'yt 'plato)) +(let world (Write! world mr_sink (Key '('table (String 'Output)) ) table1 '() )) +(let world (Commit! world mr_sink)) +(return world) +) diff --git a/yql/essentials/tests/s-expressions/suites/View/TrivialScheme.yql b/yql/essentials/tests/s-expressions/suites/View/TrivialScheme.yql new file mode 100644 index 0000000000..8062a7feb8 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/TrivialScheme.yql @@ -0,0 +1,11 @@ +( +#comment +(let mr_source (DataSource 'yt 'plato)) +(let x (Read! world mr_source (Key '('tablescheme (String 'Input)) '('view (String 'trivial))) (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/View/ViewWithUdf.cfg b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdf.cfg new file mode 100644 index 0000000000..d3e8c7c671 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdf.cfg @@ -0,0 +1,3 @@ +in Input input4.txt +res result.txt +udf simple_udf diff --git a/yql/essentials/tests/s-expressions/suites/View/ViewWithUdf.yql b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdf.yql new file mode 100644 index 0000000000..4d2b6066ad --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdf.yql @@ -0,0 +1,16 @@ +( +(let mr_source (DataSource 'yt 'plato)) +(let res_sink (DataSink 'result)) + +(let x (Read! world mr_source (Key + '('table (String 'Input)) + '('view (String 'key1)) +) (Void) '())) + +(let world (Left! x)) +(let data (Right! x)) + +(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/View/ViewWithUdfProcess.cfg b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdfProcess.cfg new file mode 100644 index 0000000000..b2849b4f98 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdfProcess.cfg @@ -0,0 +1,3 @@ +in Input input6.txt +res result.txt +udf python2_udf diff --git a/yql/essentials/tests/s-expressions/suites/View/ViewWithUdfProcess.yql b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdfProcess.yql new file mode 100644 index 0000000000..e5dc7a8838 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/ViewWithUdfProcess.yql @@ -0,0 +1,16 @@ +( +(let mr_source (DataSource 'yt 'plato)) +(let res_sink (DataSink 'result)) + +(let x (Read! world mr_source (Key + '('table (String 'Input)) + '('view (String 'my)) +) (Void) '())) + +(let world (Left! x)) +(let data (Right! x)) + +(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/View/default.cfg b/yql/essentials/tests/s-expressions/suites/View/default.cfg new file mode 100644 index 0000000000..fe2b19a9ff --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/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/View/input.txt b/yql/essentials/tests/s-expressions/suites/View/input.txt new file mode 100644 index 0000000000..df76c64125 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input.txt @@ -0,0 +1,4 @@ +{"key"="075";"subkey"="1";"value"="a7c"}; +{"key"="800";"subkey"="2";"value"="ddd"}; +{"key"="020";"subkey"="3";"value"="q"}; +{"key"="150";"subkey"="4";"value"="q8z"}; diff --git a/yql/essentials/tests/s-expressions/suites/View/input.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input.txt.attr new file mode 100644 index 0000000000..06c67fd2cb --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input.txt.attr @@ -0,0 +1,33 @@ +{ + "_yql_view_trivial"="SELECT key, subkey, value FROM self"; + "_yql_view_key1"="SELECT key || \"key\" FROM self"; + "_yql_view_noread"="SELECT 1 as key, 2 as value"; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/s-expressions/suites/View/input2.txt b/yql/essentials/tests/s-expressions/suites/View/input2.txt new file mode 100644 index 0000000000..df76c64125 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input2.txt @@ -0,0 +1,4 @@ +{"key"="075";"subkey"="1";"value"="a7c"}; +{"key"="800";"subkey"="2";"value"="ddd"}; +{"key"="020";"subkey"="3";"value"="q"}; +{"key"="150";"subkey"="4";"value"="q8z"}; diff --git a/yql/essentials/tests/s-expressions/suites/View/input2.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input2.txt.attr new file mode 100644 index 0000000000..4e7dfb3804 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input2.txt.attr @@ -0,0 +1,37 @@ +{ + "_yql_view_trivial"="SELECT key, subkey, value FROM self"; + "_yql_view_key1"="SELECT key || \"key\" FROM self"; + "_yql_view_key2"="SELECT key || \"key\" FROM self_raw"; + "_yql_view_noread"="SELECT 1 as key, 2 as value"; + "_yql_read_udf"="DummyLog.ReadRecord2"; + "_yql_read_udf_type_config"="AAA"; + "_yql_read_udf_run_config"="BBB"; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/s-expressions/suites/View/input3.txt b/yql/essentials/tests/s-expressions/suites/View/input3.txt new file mode 100644 index 0000000000..ad6793f93c --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input3.txt @@ -0,0 +1,4 @@ +{"key"="075";"subkey"="1";"value"="a=B@@b=a@@c=a"}; +{"key"="800";"subkey"="2";"value"="b=1@@c=2@@d=3"}; +{"key"="020";"subkey"="3";"value"="a=i@@c=j"}; +{"key"="150";"subkey"="4";"value"="a=A"}; diff --git a/yql/essentials/tests/s-expressions/suites/View/input3.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input3.txt.attr new file mode 100644 index 0000000000..14544c6d7b --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input3.txt.attr @@ -0,0 +1,32 @@ +{ + "_yql_read_udf"="Dsv.ReadRecord"; + "_yql_read_udf_run_config"="@@"; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/s-expressions/suites/View/input4.txt b/yql/essentials/tests/s-expressions/suites/View/input4.txt new file mode 100644 index 0000000000..d15f960f63 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input4.txt @@ -0,0 +1,10 @@ +{"key"="0";"subkey"="-";"value"="zero"}; +{"key"="1";"subkey"="-";"value"="one"}; +{"key"="2";"subkey"="-";"value"="two"}; +{"key"="3";"subkey"="-";"value"="three"}; +{"key"="4";"subkey"="-";"value"="four"}; +{"key"="5";"subkey"="-";"value"="five"}; +{"key"="6";"subkey"="-";"value"="six"}; +{"key"="7";"subkey"="-";"value"="seven"}; +{"key"="8";"subkey"="-";"value"="eight"}; +{"key"="9";"subkey"="-";"value"="nine"}; diff --git a/yql/essentials/tests/s-expressions/suites/View/input4.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input4.txt.attr new file mode 100644 index 0000000000..e6e4b7d750 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input4.txt.attr @@ -0,0 +1,32 @@ +{ + "_yql_view_key1"="SELECT SimpleUdf::Concat(SimpleUdf::Concat(key, \" - \"), value) FROM self"; + "_yql_view_key2"="SELECT key || \"key\" FROM self_raw"; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/s-expressions/suites/View/input5.txt b/yql/essentials/tests/s-expressions/suites/View/input5.txt new file mode 100644 index 0000000000..24f23d3d81 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input5.txt @@ -0,0 +1 @@ +{"key"="foo";"subkey"=".";"value"="bar"}; diff --git a/yql/essentials/tests/s-expressions/suites/View/input5.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input5.txt.attr new file mode 100644 index 0000000000..b6100e5fd0 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input5.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/View/input6.txt b/yql/essentials/tests/s-expressions/suites/View/input6.txt new file mode 100644 index 0000000000..d15f960f63 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input6.txt @@ -0,0 +1,10 @@ +{"key"="0";"subkey"="-";"value"="zero"}; +{"key"="1";"subkey"="-";"value"="one"}; +{"key"="2";"subkey"="-";"value"="two"}; +{"key"="3";"subkey"="-";"value"="three"}; +{"key"="4";"subkey"="-";"value"="four"}; +{"key"="5";"subkey"="-";"value"="five"}; +{"key"="6";"subkey"="-";"value"="six"}; +{"key"="7";"subkey"="-";"value"="seven"}; +{"key"="8";"subkey"="-";"value"="eight"}; +{"key"="9";"subkey"="-";"value"="nine"}; diff --git a/yql/essentials/tests/s-expressions/suites/View/input6.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input6.txt.attr new file mode 100644 index 0000000000..501fdca6db --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input6.txt.attr @@ -0,0 +1,31 @@ +{ + "_yql_view_my"="$udfScript=\"def f(row):\n\treturn {'myvalue':b'm' + row.value}\n\";$udf=Python::f(Callable<(Struct<key:String,subkey:String,value:String>)->Struct<myvalue:String>>, $udfScript);PROCESS self USING $udf(TableRow());"; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/s-expressions/suites/View/input_view.txt b/yql/essentials/tests/s-expressions/suites/View/input_view.txt new file mode 100644 index 0000000000..d664c9eec9 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input_view.txt @@ -0,0 +1,10 @@ +$f = ($x)->{return $x+1}; + +select key,min(num) as num from ( +select key,$f(0) as `num` from Input1 +union all +select key,$f(1) as `num` from Input2 +) +group by key +order by key + diff --git a/yql/essentials/tests/s-expressions/suites/View/input_view.txt.attr b/yql/essentials/tests/s-expressions/suites/View/input_view.txt.attr new file mode 100644 index 0000000000..41ea51e276 --- /dev/null +++ b/yql/essentials/tests/s-expressions/suites/View/input_view.txt.attr @@ -0,0 +1,4 @@ +{ + "_yql_type"="view"; + "type"="document"; +} |