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/sql/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/sql/suites/view')
60 files changed, 474 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/view/all_from_view.cfg b/yql/essentials/tests/sql/suites/view/all_from_view.cfg new file mode 100644 index 0000000000..8b7633b301 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/all_from_view.cfg @@ -0,0 +1 @@ +in Input view_input.txt diff --git a/yql/essentials/tests/sql/suites/view/all_from_view.sql b/yql/essentials/tests/sql/suites/view/all_from_view.sql new file mode 100644 index 0000000000..9deea8173f --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/all_from_view.sql @@ -0,0 +1,3 @@ +/* postgres can not */ +/* syntax version 1 */ +SELECT * FROM plato.`Input` VIEW `key`; diff --git a/yql/essentials/tests/sql/suites/view/default.cfg b/yql/essentials/tests/sql/suites/view/default.cfg new file mode 100644 index 0000000000..58878f8945 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/default.cfg @@ -0,0 +1 @@ +in Input input.txt diff --git a/yql/essentials/tests/sql/suites/view/file_eval.cfg b/yql/essentials/tests/sql/suites/view/file_eval.cfg new file mode 100644 index 0000000000..3c3eef57dc --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/file_eval.cfg @@ -0,0 +1,2 @@ +in Input view_file.txt +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/view/file_eval.sql b/yql/essentials/tests/sql/suites/view/file_eval.sql new file mode 100644 index 0000000000..890ebdece4 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/file_eval.sql @@ -0,0 +1,5 @@ +/* postgres can not */ +/* syntax version 1 */ +pragma yt.ViewIsolation = 'true'; +USE plato; +SELECT k, s, v FROM Input VIEW file_eval; diff --git a/yql/essentials/tests/sql/suites/view/file_inner.cfg b/yql/essentials/tests/sql/suites/view/file_inner.cfg new file mode 100644 index 0000000000..6ec6d9a459 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/file_inner.cfg @@ -0,0 +1,2 @@ +in Input view_file.txt +http_file foo.txt foo.txt diff --git a/yql/essentials/tests/sql/suites/view/file_inner.sql b/yql/essentials/tests/sql/suites/view/file_inner.sql new file mode 100644 index 0000000000..fb8dd1ce41 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/file_inner.sql @@ -0,0 +1,5 @@ +/* postgres can not */ +/* syntax version 1 */ +pragma yt.ViewIsolation = 'true'; +USE plato; +SELECT k, s, v FROM Input VIEW file_inner; diff --git a/yql/essentials/tests/sql/suites/view/file_inner_library.cfg b/yql/essentials/tests/sql/suites/view/file_inner_library.cfg new file mode 100644 index 0000000000..51e0aafced --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/file_inner_library.cfg @@ -0,0 +1,2 @@ +in Input view_file_inner_library.txt +http_file mylib.sql mylib.sql.txt diff --git a/yql/essentials/tests/sql/suites/view/file_inner_library.sql b/yql/essentials/tests/sql/suites/view/file_inner_library.sql new file mode 100644 index 0000000000..f81464e158 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/file_inner_library.sql @@ -0,0 +1,5 @@ +/* postgres can not */ +/* syntax version 1 */ +pragma yt.ViewIsolation = 'true'; +USE plato; +SELECT k, s, v FROM Input VIEW file_inner_library; diff --git a/yql/essentials/tests/sql/suites/view/file_inner_udf.cfg b/yql/essentials/tests/sql/suites/view/file_inner_udf.cfg new file mode 100644 index 0000000000..9e38dc624d --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/file_inner_udf.cfg @@ -0,0 +1,4 @@ +in Input view_file_inner_udf.txt +http_file myfile yql/essentials/udfs/test/test_import/libtest_import_udf.so +os linux +providers yt diff --git a/yql/essentials/tests/sql/suites/view/file_inner_udf.sql b/yql/essentials/tests/sql/suites/view/file_inner_udf.sql new file mode 100644 index 0000000000..9b1a90e856 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/file_inner_udf.sql @@ -0,0 +1,8 @@ +/* postgres can not */ +/* syntax version 1 */ +pragma yt.ViewIsolation = 'true'; +USE plato; +SELECT k, s, v FROM Input VIEW file_inner_udf1 +UNION ALL +SELECT k, s, v FROM Input VIEW file_inner_udf2; + diff --git a/yql/essentials/tests/sql/suites/view/file_outer.cfg b/yql/essentials/tests/sql/suites/view/file_outer.cfg new file mode 100644 index 0000000000..331e1aedcc --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/file_outer.cfg @@ -0,0 +1,3 @@ +in Input view_file.txt +file foo.txt foo.txt +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/view/file_outer.sql b/yql/essentials/tests/sql/suites/view/file_outer.sql new file mode 100644 index 0000000000..bc1b0a4070 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/file_outer.sql @@ -0,0 +1,5 @@ +/* postgres can not */ +/* syntax version 1 */ +pragma yt.ViewIsolation = 'true'; +USE plato; +SELECT k, s, v FROM Input VIEW file_outer; diff --git a/yql/essentials/tests/sql/suites/view/file_outer_library.cfg b/yql/essentials/tests/sql/suites/view/file_outer_library.cfg new file mode 100644 index 0000000000..cf7d8cce56 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/file_outer_library.cfg @@ -0,0 +1,4 @@ +in Input view_file_outer_library.txt +http_file mylib.sql mylib.sql.txt +xfail + diff --git a/yql/essentials/tests/sql/suites/view/file_outer_library.sql b/yql/essentials/tests/sql/suites/view/file_outer_library.sql new file mode 100644 index 0000000000..b7e7ee2ad4 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/file_outer_library.sql @@ -0,0 +1,6 @@ +/* postgres can not */ +/* syntax version 1 */ +pragma yt.ViewIsolation = 'true'; +USE plato; +PRAGMA library('mylib.sql'); +SELECT k, s, v FROM Input VIEW file_outer_library; diff --git a/yql/essentials/tests/sql/suites/view/foo.txt b/yql/essentials/tests/sql/suites/view/foo.txt new file mode 100644 index 0000000000..f3a34851d4 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/foo.txt @@ -0,0 +1 @@ +text
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/view/init_view_after_eval.sql b/yql/essentials/tests/sql/suites/view/init_view_after_eval.sql new file mode 100644 index 0000000000..3dafc5f598 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/init_view_after_eval.sql @@ -0,0 +1,10 @@ +/* postgres can not */ +use plato; + +$i = select * from Input; +$i = process $i; + +$members = StructTypeComponents(ListItemType(TypeHandle(TypeOf($i)))); +$filteredMembers = ListFilter(ListMap($members, ($x) -> { return $x.Name }), ($x) -> { return $x > "k" }); + +select ChooseMembers(TableRow(), $filteredMembers) from Input view raw; diff --git a/yql/essentials/tests/sql/suites/view/input.txt b/yql/essentials/tests/sql/suites/view/input.txt new file mode 100644 index 0000000000..65949ea745 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/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/sql/suites/view/input_lambda.txt b/yql/essentials/tests/sql/suites/view/input_lambda.txt new file mode 100644 index 0000000000..326457a31b --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/input_lambda.txt @@ -0,0 +1 @@ +{"key"="0";"subkey"="-";"value"="zero"}; diff --git a/yql/essentials/tests/sql/suites/view/input_lambda.txt.attr b/yql/essentials/tests/sql/suites/view/input_lambda.txt.attr new file mode 100644 index 0000000000..c9e8e9e38d --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/input_lambda.txt.attr @@ -0,0 +1,32 @@ +{ + "_yql_view_lambda"="$update_key = ($key) -> ($key || '.updated'); SELECT $update_key(key) as key, subkey, value from self"; + "_yql_view_lambda_process"="$update_row = ($row) -> (AddMember($row, 'new_value', 'NEW_VALUE')); PROCESS self USING $update_row(TableRow());"; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/sql/suites/view/input_library.txt b/yql/essentials/tests/sql/suites/view/input_library.txt new file mode 100644 index 0000000000..476d61c812 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/input_library.txt @@ -0,0 +1 @@ +{"key"="FoO_1";"subkey"="-";"value"="zero"}; diff --git a/yql/essentials/tests/sql/suites/view/input_library.txt.attr b/yql/essentials/tests/sql/suites/view/input_library.txt.attr new file mode 100644 index 0000000000..f053d1dea6 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/input_library.txt.attr @@ -0,0 +1,32 @@ +{ + "_yql_view_library"="PRAGMA Library('nested_library.sql', 'http_test://nested_library.sql.txt'); import nested_library symbols $to_lower; SELECT key, subkey, value, $to_lower(key) as lower_key from self"; + "_yql_syntax_version_library"=1; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/sql/suites/view/mylib.sql.txt b/yql/essentials/tests/sql/suites/view/mylib.sql.txt new file mode 100644 index 0000000000..cd551d25c7 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/mylib.sql.txt @@ -0,0 +1,2 @@ +$x = 1; +export $x; diff --git a/yql/essentials/tests/sql/suites/view/nested_library.sql.txt b/yql/essentials/tests/sql/suites/view/nested_library.sql.txt new file mode 100644 index 0000000000..7a227412b7 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/nested_library.sql.txt @@ -0,0 +1,10 @@ +/* unrelated lambda in v1 syntax to check that syntax version for libraries in views is correctly passed */ +$unused = ($row) -> ($row); + +$lambda_code = QuoteCode(($item) -> (String::AsciiToLower($item))); + +$to_lower = EvaluateCode(LambdaCode(($item) -> { + return FuncCode("Apply", $lambda_code, $item); +})); + +export $to_lower; diff --git a/yql/essentials/tests/sql/suites/view/secure.cfg b/yql/essentials/tests/sql/suites/view/secure.cfg new file mode 100644 index 0000000000..faeeed07f3 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/secure.cfg @@ -0,0 +1,2 @@ +in Input view_secure.txt +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/view/secure.sql b/yql/essentials/tests/sql/suites/view/secure.sql new file mode 100644 index 0000000000..be73998ca2 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/secure.sql @@ -0,0 +1,5 @@ +/* postgres can not */ +/* syntax version 1 */ +pragma yt.ViewIsolation = 'true'; +USE plato; +SELECT k, s, v FROM Input VIEW secure; diff --git a/yql/essentials/tests/sql/suites/view/secure_eval.cfg b/yql/essentials/tests/sql/suites/view/secure_eval.cfg new file mode 100644 index 0000000000..faeeed07f3 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/secure_eval.cfg @@ -0,0 +1,2 @@ +in Input view_secure.txt +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/view/secure_eval.sql b/yql/essentials/tests/sql/suites/view/secure_eval.sql new file mode 100644 index 0000000000..32f07f32df --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/secure_eval.sql @@ -0,0 +1,5 @@ +/* postgres can not */ +/* syntax version 1 */ +pragma yt.ViewIsolation = 'true'; +USE plato; +SELECT k, s, v FROM Input VIEW secure_eval; diff --git a/yql/essentials/tests/sql/suites/view/secure_eval_dyn.cfg b/yql/essentials/tests/sql/suites/view/secure_eval_dyn.cfg new file mode 100644 index 0000000000..faeeed07f3 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/secure_eval_dyn.cfg @@ -0,0 +1,2 @@ +in Input view_secure.txt +xfail
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/view/secure_eval_dyn.sql b/yql/essentials/tests/sql/suites/view/secure_eval_dyn.sql new file mode 100644 index 0000000000..44f17b18da --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/secure_eval_dyn.sql @@ -0,0 +1,5 @@ +/* postgres can not */ +/* syntax version 1 */ +pragma yt.ViewIsolation = 'true'; +USE plato; +SELECT k, s, v FROM Input VIEW secure_eval_dynamic; diff --git a/yql/essentials/tests/sql/suites/view/standalone_view_lambda.cfg b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.cfg new file mode 100644 index 0000000000..b4c7e23249 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.cfg @@ -0,0 +1,3 @@ +in InputView standalone_view_lambda.txt +in Input input.txt +res result.txt diff --git a/yql/essentials/tests/sql/suites/view/standalone_view_lambda.sql b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.sql new file mode 100644 index 0000000000..7edb28296d --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.sql @@ -0,0 +1,8 @@ +use plato; + +$stream = process InputView; +$type = EvaluateType(TypeHandle(ListItemType(TypeOf($stream)))); + +$lambda = ($row) -> (Cast($row as $type)); + +process InputView using $lambda(TableRow()); diff --git a/yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt new file mode 100644 index 0000000000..bf15038909 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt @@ -0,0 +1,8 @@ +$concat = ($row) -> { + return AddMember( + $row, "foo", + $row.key || "|" || $row.subkey || "|" || $row.value + ); +}; + +process `Input` using $concat(TableRow()); diff --git a/yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt.attr b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt.attr new file mode 100644 index 0000000000..2666763633 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/standalone_view_lambda.txt.attr @@ -0,0 +1,4 @@ +{ + "_yql_type" = <syntax_version=1>"view"; + "type" = "document"; +} diff --git a/yql/essentials/tests/sql/suites/view/system_udf.cfg b/yql/essentials/tests/sql/suites/view/system_udf.cfg new file mode 100644 index 0000000000..3760566137 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/system_udf.cfg @@ -0,0 +1,2 @@ +in Input view_system_udf.txt +udf string_udf diff --git a/yql/essentials/tests/sql/suites/view/system_udf.sql b/yql/essentials/tests/sql/suites/view/system_udf.sql new file mode 100644 index 0000000000..e5599aa9c2 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/system_udf.sql @@ -0,0 +1,5 @@ +/* postgres can not */ +/* syntax version 1 */ +pragma yt.ViewIsolation = 'true'; +USE plato; +SELECT k, s, v FROM Input VIEW system_udf; diff --git a/yql/essentials/tests/sql/suites/view/trivial_view.cfg b/yql/essentials/tests/sql/suites/view/trivial_view.cfg new file mode 100644 index 0000000000..8b7633b301 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/trivial_view.cfg @@ -0,0 +1 @@ +in Input view_input.txt diff --git a/yql/essentials/tests/sql/suites/view/trivial_view.sql b/yql/essentials/tests/sql/suites/view/trivial_view.sql new file mode 100644 index 0000000000..d126465c8c --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/trivial_view.sql @@ -0,0 +1,4 @@ +/* postgres can not */ +/* syntax version 1 */ +USE plato; +SELECT k, s, v FROM Input VIEW ksv; diff --git a/yql/essentials/tests/sql/suites/view/trivial_view_concat.cfg b/yql/essentials/tests/sql/suites/view/trivial_view_concat.cfg new file mode 100644 index 0000000000..8b7633b301 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/trivial_view_concat.cfg @@ -0,0 +1 @@ +in Input view_input.txt diff --git a/yql/essentials/tests/sql/suites/view/trivial_view_concat.sql b/yql/essentials/tests/sql/suites/view/trivial_view_concat.sql new file mode 100644 index 0000000000..bad7874f6b --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/trivial_view_concat.sql @@ -0,0 +1,4 @@ +/* postgres can not */ +/* syntax version 1 */ +USE plato; +SELECT k, s, v FROM concat(Input view ksv, Input view ksv); diff --git a/yql/essentials/tests/sql/suites/view/view_file.txt b/yql/essentials/tests/sql/suites/view/view_file.txt new file mode 100644 index 0000000000..df76c64125 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_file.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/sql/suites/view/view_file.txt.attr b/yql/essentials/tests/sql/suites/view/view_file.txt.attr new file mode 100644 index 0000000000..b70ac5691b --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_file.txt.attr @@ -0,0 +1,33 @@ +{ + "_yql_view_file_eval"="SELECT EvaluateCode(FuncCode('FileContent', AtomCode('foo.txt'))) as k, subkey as s, value as v FROM self"; + "_yql_view_file_outer"="SELECT FileContent('foo' || '.txt') as k, subkey as s, value as v FROM self"; + "_yql_view_file_inner"="pragma file('foo.txt','http_test://foo.txt');SELECT FileContent('foo.txt') as k, subkey as s, value as v FROM self"; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/sql/suites/view/view_file_inner_library.txt b/yql/essentials/tests/sql/suites/view/view_file_inner_library.txt new file mode 100644 index 0000000000..df76c64125 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_file_inner_library.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/sql/suites/view/view_file_inner_library.txt.attr b/yql/essentials/tests/sql/suites/view/view_file_inner_library.txt.attr new file mode 100644 index 0000000000..43581a8c93 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_file_inner_library.txt.attr @@ -0,0 +1,31 @@ +{ + "_yql_view_file_inner_library"="PRAGMA library('mylib.sql','http_test://mylib.sql');IMPORT mylib SYMBOLS $x;select $x as k, 2 as s, 3 as v"; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/sql/suites/view/view_file_inner_udf.txt b/yql/essentials/tests/sql/suites/view/view_file_inner_udf.txt new file mode 100644 index 0000000000..df76c64125 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_file_inner_udf.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/sql/suites/view/view_file_inner_udf.txt.attr b/yql/essentials/tests/sql/suites/view/view_file_inner_udf.txt.attr new file mode 100644 index 0000000000..51babfc5e8 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_file_inner_udf.txt.attr @@ -0,0 +1,32 @@ +{ + "_yql_view_file_inner_udf1"="PRAGMA file('myfile','http_test://myfile');PRAGMA udf('myfile');select TestImportUdf::Concat(key,'!') as k, 2 as s, 3 as v from self"; + "_yql_view_file_inner_udf2"="PRAGMA file('myfile','http_test://myfile');PRAGMA udf('myfile');select TestImportUdf::Concat(key,'?') as k, 2 as s, 3 as v from self"; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/sql/suites/view/view_file_outer_library.txt b/yql/essentials/tests/sql/suites/view/view_file_outer_library.txt new file mode 100644 index 0000000000..df76c64125 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_file_outer_library.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/sql/suites/view/view_file_outer_library.txt.attr b/yql/essentials/tests/sql/suites/view/view_file_outer_library.txt.attr new file mode 100644 index 0000000000..c0e969f6f1 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_file_outer_library.txt.attr @@ -0,0 +1,31 @@ +{ + "_yql_view_file_outer_library"="IMPORT mylib SYMBOLS $x;select $x as k, 2 as s, 3 as v"; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/sql/suites/view/view_input.txt b/yql/essentials/tests/sql/suites/view/view_input.txt new file mode 100644 index 0000000000..df76c64125 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/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/sql/suites/view/view_input.txt.attr b/yql/essentials/tests/sql/suites/view/view_input.txt.attr new file mode 100644 index 0000000000..07386c98e5 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_input.txt.attr @@ -0,0 +1,32 @@ +{ + "_yql_view_ksv"="SELECT key as k, subkey as s, value as v FROM self"; + "_yql_view_key"="SELECT key FROM self"; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/sql/suites/view/view_secure.txt b/yql/essentials/tests/sql/suites/view/view_secure.txt new file mode 100644 index 0000000000..df76c64125 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_secure.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/sql/suites/view/view_secure.txt.attr b/yql/essentials/tests/sql/suites/view/view_secure.txt.attr new file mode 100644 index 0000000000..2d8ed382fc --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_secure.txt.attr @@ -0,0 +1,33 @@ +{ + "_yql_view_secure"="SELECT SecureParam('api:oauth') as k, subkey as s, value as v FROM self"; + "_yql_view_secure_eval"="SELECT EvaluateCode(FuncCode('SecureParam', AtomCode('api:oauth'))) as k, subkey as s, value as v FROM self"; + "_yql_view_secure_eval_dynamic"="SELECT EvaluateCode(FuncCode('S' || 'ecureParam', AtomCode('api:oauth'))) as k, subkey as s, value as v FROM self"; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/sql/suites/view/view_system_udf.txt b/yql/essentials/tests/sql/suites/view/view_system_udf.txt new file mode 100644 index 0000000000..df76c64125 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_system_udf.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/sql/suites/view/view_system_udf.txt.attr b/yql/essentials/tests/sql/suites/view/view_system_udf.txt.attr new file mode 100644 index 0000000000..2badea2c2a --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_system_udf.txt.attr @@ -0,0 +1,31 @@ +{ + "_yql_view_system_udf"="SELECT String::Strip(key) as k, subkey as s, value as v FROM self"; + "_yql_row_spec" = { + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ] + } +} diff --git a/yql/essentials/tests/sql/suites/view/view_with_lambda.cfg b/yql/essentials/tests/sql/suites/view/view_with_lambda.cfg new file mode 100644 index 0000000000..8cb4920700 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_with_lambda.cfg @@ -0,0 +1,2 @@ +in Input input_lambda.txt +res result.txt diff --git a/yql/essentials/tests/sql/suites/view/view_with_lambda.sql b/yql/essentials/tests/sql/suites/view/view_with_lambda.sql new file mode 100644 index 0000000000..c698d5c100 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_with_lambda.sql @@ -0,0 +1,2 @@ +use plato; +select * from Input view lambda; diff --git a/yql/essentials/tests/sql/suites/view/view_with_lambda_process.cfg b/yql/essentials/tests/sql/suites/view/view_with_lambda_process.cfg new file mode 100644 index 0000000000..8cb4920700 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_with_lambda_process.cfg @@ -0,0 +1,2 @@ +in Input input_lambda.txt +res result.txt diff --git a/yql/essentials/tests/sql/suites/view/view_with_lambda_process.sql b/yql/essentials/tests/sql/suites/view/view_with_lambda_process.sql new file mode 100644 index 0000000000..0db9c8b8ce --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_with_lambda_process.sql @@ -0,0 +1,2 @@ +use plato; +select * from Input view lambda_process; diff --git a/yql/essentials/tests/sql/suites/view/view_with_library.cfg b/yql/essentials/tests/sql/suites/view/view_with_library.cfg new file mode 100644 index 0000000000..fa1b395601 --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_with_library.cfg @@ -0,0 +1,3 @@ +in Input input_library.txt +http_file nested_library.sql.txt nested_library.sql.txt +res result.txt diff --git a/yql/essentials/tests/sql/suites/view/view_with_library.sql b/yql/essentials/tests/sql/suites/view/view_with_library.sql new file mode 100644 index 0000000000..3d10f4272f --- /dev/null +++ b/yql/essentials/tests/sql/suites/view/view_with_library.sql @@ -0,0 +1,2 @@ +use plato; +select * from Input view `library`; |