diff options
author | Maxim Yurchuk <maxim-yurchuk@ydb.tech> | 2024-11-20 17:37:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-20 17:37:57 +0000 |
commit | f76323e9b295c15751e51e3443aa47a36bee8023 (patch) | |
tree | 4113c8cad473a33e0f746966e0cf087252fa1d7a /yql/essentials/tests/sql/suites/table_range | |
parent | 753ecb8d410a4cb459c26f3a0082fb2d1724fe63 (diff) | |
parent | a7b9a6afea2a9d7a7bfac4c5eb4c1a8e60adb9e6 (diff) | |
download | ydb-f76323e9b295c15751e51e3443aa47a36bee8023.tar.gz |
Merge pull request #11788 from ydb-platform/mergelibs-241120-1113
Library import 241120-1113
Diffstat (limited to 'yql/essentials/tests/sql/suites/table_range')
54 files changed, 373 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.cfg b/yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.cfg new file mode 100644 index 0000000000..040f725d60 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.cfg @@ -0,0 +1,2 @@ +in Input1 empty_int64.txt +in Input2 empty_uint32.txt diff --git a/yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.sql b/yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.sql new file mode 100644 index 0000000000..d30c32b9b0 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/concat_empty_sorted_with_key_diff.sql @@ -0,0 +1,3 @@ +USE plato; + +SELECT * FROM concat(Input1, Input2);
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.cfg b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.cfg new file mode 100644 index 0000000000..c717a38afa --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.cfg @@ -0,0 +1,4 @@ +in Input sorted1.txt +out Output output.txt +providers yt + diff --git a/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.sql b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.sql new file mode 100644 index 0000000000..bd692d7685 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_sorted_tables.sql @@ -0,0 +1,14 @@ +/* postgres can not */ +/* kikimr can not */ +/* multirun can not */ +USE plato; +pragma yt.MaxInputTables="3"; +pragma yt.MaxInputTablesForSortedMerge="2"; + +INSERT INTO Output +SELECT + key, + value +FROM concat(Input, Input, Input, Input) +ORDER BY key +;
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.cfg b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.cfg new file mode 100644 index 0000000000..b6e7b1a582 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.cfg @@ -0,0 +1,2 @@ +in Input sorted1.txt +out Output output.txt diff --git a/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.sql b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.sql new file mode 100644 index 0000000000..08a4e76749 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/concat_sorted_max_tables.sql @@ -0,0 +1,13 @@ +/* postgres can not */ +/* kikimr can not */ +/* multirun can not */ +USE plato; +pragma yt.MaxInputTables="3"; +pragma yt.MaxInputTablesForSortedMerge="2"; + +INSERT INTO Output +SELECT + key, + value +FROM concat(Input, Input, Input, Input) +;
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.cfg b/yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.cfg new file mode 100644 index 0000000000..4ea0bf2550 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.cfg @@ -0,0 +1,2 @@ +in Input1 sorted1.txt +in Input2 sorted2.txt diff --git a/yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.sql b/yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.sql new file mode 100644 index 0000000000..3e752de8b8 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/concat_sorted_with_key_diff.sql @@ -0,0 +1,3 @@ +/* postgres can not */ +/* kikimr can not - range not supported */ +select * from plato.concat("Input1", "Input2") order by key, subkey; diff --git a/yql/essentials/tests/sql/suites/table_range/concat_with_view.cfg b/yql/essentials/tests/sql/suites/table_range/concat_with_view.cfg new file mode 100644 index 0000000000..c4e9cf98a2 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/concat_with_view.cfg @@ -0,0 +1,4 @@ +in InputA input.txt +in InputD doc_view.txt +in Input1 input.txt +in Input2 input.txt diff --git a/yql/essentials/tests/sql/suites/table_range/concat_with_view.sql b/yql/essentials/tests/sql/suites/table_range/concat_with_view.sql new file mode 100644 index 0000000000..c9ea1fd45b --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/concat_with_view.sql @@ -0,0 +1,3 @@ +/* postgres can not */ +/* kikimr can not - range not supported */ +select * from plato.concat("InputA", "InputD"); diff --git a/yql/essentials/tests/sql/suites/table_range/doc_view.txt b/yql/essentials/tests/sql/suites/table_range/doc_view.txt new file mode 100644 index 0000000000..d664c9eec9 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/doc_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/sql/suites/table_range/doc_view.txt.attr b/yql/essentials/tests/sql/suites/table_range/doc_view.txt.attr new file mode 100644 index 0000000000..41ea51e276 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/doc_view.txt.attr @@ -0,0 +1,4 @@ +{ + "_yql_type"="view"; + "type"="document"; +} diff --git a/yql/essentials/tests/sql/suites/table_range/each_with_non_existing-all_fail.cfg b/yql/essentials/tests/sql/suites/table_range/each_with_non_existing-all_fail.cfg new file mode 100644 index 0000000000..62226ec6e8 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/each_with_non_existing-all_fail.cfg @@ -0,0 +1,4 @@ +xfail +in Input1 nonexist.txt +in Input2 nonexist.txt +in Input3 nonexist.txt diff --git a/yql/essentials/tests/sql/suites/table_range/each_with_non_existing.cfg b/yql/essentials/tests/sql/suites/table_range/each_with_non_existing.cfg new file mode 100644 index 0000000000..51e035b460 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/each_with_non_existing.cfg @@ -0,0 +1,3 @@ +in Input1 input.txt +in Input2 nonexist.txt +in Input3 nonexist.txt diff --git a/yql/essentials/tests/sql/suites/table_range/each_with_non_existing.sql b/yql/essentials/tests/sql/suites/table_range/each_with_non_existing.sql new file mode 100644 index 0000000000..a2527cc655 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/each_with_non_existing.sql @@ -0,0 +1,4 @@ +/* syntax version 1 */ +/* kikimr can not - range not supported */ +USE plato; +SELECT * FROM each(["Input1", "Input2", "Input3"]); diff --git a/yql/essentials/tests/sql/suites/table_range/empty_int64.txt b/yql/essentials/tests/sql/suites/table_range/empty_int64.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/empty_int64.txt diff --git a/yql/essentials/tests/sql/suites/table_range/empty_int64.txt.attr b/yql/essentials/tests/sql/suites/table_range/empty_int64.txt.attr new file mode 100644 index 0000000000..5a3a989e42 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/empty_int64.txt.attr @@ -0,0 +1,11 @@ +{"_yql_row_spec"={ + "Type"=["StructType";[ + ["key";["DataType";"Int64"]]; + ["subkey";["DataType";"String"]]; + ["value";["DataType";"String"]] + ]]; + "SortDirections"=[1]; + "SortedBy"=["key"]; + "SortedByTypes"=[["DataType";"Int64";]]; + "SortMembers"=["key"]; +}} diff --git a/yql/essentials/tests/sql/suites/table_range/empty_uint32.txt b/yql/essentials/tests/sql/suites/table_range/empty_uint32.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/empty_uint32.txt diff --git a/yql/essentials/tests/sql/suites/table_range/empty_uint32.txt.attr b/yql/essentials/tests/sql/suites/table_range/empty_uint32.txt.attr new file mode 100644 index 0000000000..9bd4ce7778 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/empty_uint32.txt.attr @@ -0,0 +1,11 @@ +{"_yql_row_spec"={ + "Type"=["StructType";[ + ["key";["DataType";"Uint32"]]; + ["subkey";["DataType";"String"]]; + ["value";["DataType";"String"]] + ]]; + "SortDirections"=[1]; + "SortedBy"=["key"]; + "SortedByTypes"=[["DataType";"Uint32";]]; + "SortMembers"=["key"]; +}} diff --git a/yql/essentials/tests/sql/suites/table_range/input.txt b/yql/essentials/tests/sql/suites/table_range/input.txt new file mode 100644 index 0000000000..65949ea745 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/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/table_range/limit_with_table_path_over_sorted_range.cfg b/yql/essentials/tests/sql/suites/table_range/limit_with_table_path_over_sorted_range.cfg new file mode 100644 index 0000000000..7cc6ef73bf --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/limit_with_table_path_over_sorted_range.cfg @@ -0,0 +1,2 @@ +in Input1 sorted1.txt +in Input2 sorted1.txt diff --git a/yql/essentials/tests/sql/suites/table_range/limit_with_table_path_over_sorted_range.sql b/yql/essentials/tests/sql/suites/table_range/limit_with_table_path_over_sorted_range.sql new file mode 100644 index 0000000000..6e940b08a8 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/limit_with_table_path_over_sorted_range.sql @@ -0,0 +1,7 @@ +/* postgres can not */ +/* kikimr can not */ + +SELECT key, value, SUBSTRING(TablePath(), NULL, CAST(LENGTH(TablePath()) - 1 as Uint32)) as path +FROM plato.range("","Input1", "Input2") +LIMIT 2 +;
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/table_range/merge_non_strict.cfg b/yql/essentials/tests/sql/suites/table_range/merge_non_strict.cfg new file mode 100644 index 0000000000..b9f4d07258 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/merge_non_strict.cfg @@ -0,0 +1,2 @@ +in Input1 sorted_non_strict.txt +in Input2 sorted1.txt
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/table_range/merge_non_strict.sql b/yql/essentials/tests/sql/suites/table_range/merge_non_strict.sql new file mode 100644 index 0000000000..97d2b56b77 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/merge_non_strict.sql @@ -0,0 +1,6 @@ +/* postgres can not */ +USE plato; + +SELECT key, subkey FROM CONCAT(Input1, Input1) ORDER BY key, subkey; + +SELECT key, subkey FROM CONCAT(Input1, Input2) ORDER BY key, subkey; diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_desc.cfg b/yql/essentials/tests/sql/suites/table_range/range_over_desc.cfg new file mode 100644 index 0000000000..ceaf2a5ea3 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_over_desc.cfg @@ -0,0 +1,2 @@ +in Input1 sorted_desc.txt +in Input2 sorted_desc.txt diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_desc.sql b/yql/essentials/tests/sql/suites/table_range/range_over_desc.sql new file mode 100644 index 0000000000..fa2f513898 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_over_desc.sql @@ -0,0 +1,7 @@ +/* postgres can not */ +/* kikimr can not - range not supported */ +/* syntax version 1 */ +use plato; + +select t.*, TableName() as path from range("","Input1", "Input2") as t +order by path, key, value; diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_filter.cfg b/yql/essentials/tests/sql/suites/table_range/range_over_filter.cfg new file mode 100644 index 0000000000..c6cac50799 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_over_filter.cfg @@ -0,0 +1,3 @@ +in Input input.txt +udf python3_udf +udf unicode_udf diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_filter.sql b/yql/essentials/tests/sql/suites/table_range/range_over_filter.sql new file mode 100644 index 0000000000..682f3fdb79 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_over_filter.sql @@ -0,0 +1,12 @@ +/* postgres can not */ +/* syntax version 1 */ +/* kikimr can not - range not supported */ +select count(*) as count from plato.filter(``, Unicode::IsUtf); + +$script = @@ +def f(s): + return True +@@; + +$callable = Python3::f(Callable<(String)->Bool?>,$script); +select count(*) as count from plato.filter(``, $callable); diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.cfg b/yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.cfg new file mode 100644 index 0000000000..6149ae4837 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.cfg @@ -0,0 +1,3 @@ +in Input input.txt +udf python3_udf +udf re2_udf diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.sql b/yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.sql new file mode 100644 index 0000000000..4756b27c4b --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_over_filter_udf.sql @@ -0,0 +1,16 @@ +/* postgres can not */ +/* syntax version 1 */ +/* kikimr can not - range not supported */ +$script = @@ +def f(f): + def ft(s): + return True + def ff(s): + return False + return f and ft or ff +@@; + +$callable = Python3::f(Callable<(Bool)->Callable<(String)->Bool>>,$script); +$callableT = $callable(Re2::Match('test.*')('testfets')); + +select count(*) as count from plato.filter(``, $callableT); diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_like.cfg b/yql/essentials/tests/sql/suites/table_range/range_over_like.cfg new file mode 100644 index 0000000000..e300a83153 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_over_like.cfg @@ -0,0 +1,2 @@ +in Input input.txt +udf re2_udf diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_like.sql b/yql/essentials/tests/sql/suites/table_range/range_over_like.sql new file mode 100644 index 0000000000..28a45f57fe --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_over_like.sql @@ -0,0 +1,4 @@ +/* postgres can not */ +/* kikimr can not - range not supported */ +/* syntax version 1 */ +select count(*) as count from plato.like(``, "_np%"); diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_regexp.cfg b/yql/essentials/tests/sql/suites/table_range/range_over_regexp.cfg new file mode 100644 index 0000000000..ce7c51a32a --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_over_regexp.cfg @@ -0,0 +1,2 @@ +in Input input.txt +udf pire_udf diff --git a/yql/essentials/tests/sql/suites/table_range/range_over_regexp.sql b/yql/essentials/tests/sql/suites/table_range/range_over_regexp.sql new file mode 100644 index 0000000000..f78820f952 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_over_regexp.sql @@ -0,0 +1,5 @@ +/* postgres can not */ +/* kikimr can not - range not supported */ +/* syntax version 1 */ +PRAGMA RegexUseRe2='true'; +select count(*) as count from plato.regexp(``, "np"); diff --git a/yql/essentials/tests/sql/suites/table_range/range_slash.cfg b/yql/essentials/tests/sql/suites/table_range/range_slash.cfg new file mode 100644 index 0000000000..53bfd46c84 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_slash.cfg @@ -0,0 +1,3 @@ +in Input1 input.txt +in Input2 input.txt + diff --git a/yql/essentials/tests/sql/suites/table_range/range_slash.sql b/yql/essentials/tests/sql/suites/table_range/range_slash.sql new file mode 100644 index 0000000000..f0a2693294 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_slash.sql @@ -0,0 +1,9 @@ +/* syntax version 1 */ +USE plato; + +SELECT * +FROM RANGE("/", "Input1", "Input2", "/"); + +SELECT * +FROM RANGE("/", "Input1", "Input2", "/"); + diff --git a/yql/essentials/tests/sql/suites/table_range/range_tables_with_view.cfg b/yql/essentials/tests/sql/suites/table_range/range_tables_with_view.cfg new file mode 100644 index 0000000000..8b7633b301 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_tables_with_view.cfg @@ -0,0 +1 @@ +in Input view_input.txt diff --git a/yql/essentials/tests/sql/suites/table_range/range_tables_with_view.sql b/yql/essentials/tests/sql/suites/table_range/range_tables_with_view.sql new file mode 100644 index 0000000000..b1dc52aa63 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_tables_with_view.sql @@ -0,0 +1,3 @@ +/* postgres can not */ +/* syntax version 1 */ +select count(*) as count from plato.range(``, ``, ``, ``, ksv); diff --git a/yql/essentials/tests/sql/suites/table_range/range_with_view.cfg b/yql/essentials/tests/sql/suites/table_range/range_with_view.cfg new file mode 100644 index 0000000000..c4e9cf98a2 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_with_view.cfg @@ -0,0 +1,4 @@ +in InputA input.txt +in InputD doc_view.txt +in Input1 input.txt +in Input2 input.txt diff --git a/yql/essentials/tests/sql/suites/table_range/range_with_view.sql b/yql/essentials/tests/sql/suites/table_range/range_with_view.sql new file mode 100644 index 0000000000..4e28ca82e7 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/range_with_view.sql @@ -0,0 +1,3 @@ +/* postgres can not */ +/* kikimr can not - range not supported */ +select * from plato.range("","InputA", "InputD"); diff --git a/yql/essentials/tests/sql/suites/table_range/sorted1.txt b/yql/essentials/tests/sql/suites/table_range/sorted1.txt new file mode 100644 index 0000000000..2ede97b886 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/sorted1.txt @@ -0,0 +1,6 @@ +{"key"="023";"subkey"="3";"value"="aaa"}; +{"key"="037";"subkey"="5";"value"="ddd"}; +{"key"="075";"subkey"="1";"value"="abc"}; +{"key"="150";"subkey"="1";"value"="aaa"}; +{"key"="150";"subkey"="3";"value"="iii"}; +{"key"="150";"subkey"="8";"value"="zzz"}; diff --git a/yql/essentials/tests/sql/suites/table_range/sorted1.txt.attr b/yql/essentials/tests/sql/suites/table_range/sorted1.txt.attr new file mode 100644 index 0000000000..ed13e20223 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/sorted1.txt.attr @@ -0,0 +1,11 @@ +{"_yql_row_spec"={ + "Type"=["StructType";[ + ["key";["DataType";"String"]]; + ["subkey";["DataType";"String"]]; + ["value";["DataType";"String"]] + ]]; + "SortDirections"=[1;1;]; + "SortedBy"=["key";"subkey";]; + "SortedByTypes"=[["DataType";"String";];["DataType";"String";];]; + "SortMembers"=["key";"subkey";]; +}} diff --git a/yql/essentials/tests/sql/suites/table_range/sorted2.txt b/yql/essentials/tests/sql/suites/table_range/sorted2.txt new file mode 100644 index 0000000000..2ede97b886 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/sorted2.txt @@ -0,0 +1,6 @@ +{"key"="023";"subkey"="3";"value"="aaa"}; +{"key"="037";"subkey"="5";"value"="ddd"}; +{"key"="075";"subkey"="1";"value"="abc"}; +{"key"="150";"subkey"="1";"value"="aaa"}; +{"key"="150";"subkey"="3";"value"="iii"}; +{"key"="150";"subkey"="8";"value"="zzz"}; diff --git a/yql/essentials/tests/sql/suites/table_range/sorted2.txt.attr b/yql/essentials/tests/sql/suites/table_range/sorted2.txt.attr new file mode 100644 index 0000000000..02e438f8df --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/sorted2.txt.attr @@ -0,0 +1,11 @@ +{"_yql_row_spec"={ + "Type"=["StructType";[ + ["key";["DataType";"String"]]; + ["subkey";["OptionalType"; ["DataType";"String";]]]; + ["value";["DataType";"String"]] + ]]; + "SortDirections"=[1;1;]; + "SortedBy"=["key";"subkey";]; + "SortedByTypes"=[["DataType";"String";];["OptionalType"; ["DataType";"String";]];]; + "SortMembers"=["key";"subkey";]; +}} diff --git a/yql/essentials/tests/sql/suites/table_range/sorted_desc.txt b/yql/essentials/tests/sql/suites/table_range/sorted_desc.txt new file mode 100644 index 0000000000..235fc7cd49 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/sorted_desc.txt @@ -0,0 +1,10 @@ +{"_yql_column_0"="\xE0\xC6\xCE\xCE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="911";"subkey"="2";"value"="kkk"}; +{"_yql_column_0"="\xE0\xC8\xC9\xCE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="761";"subkey"="6";"value"="ccc"}; +{"_yql_column_0"="\xE0\xCA\xCD\xC8\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="527";"subkey"="4";"value"="bbb"}; +{"_yql_column_0"="\xE0\xCD\xCF\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="200";"subkey"="7";"value"="qqq"}; +{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="1";"value"="aaa"}; +{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="3";"value"="iii"}; +{"_yql_column_0"="\xE0\xCE\xCA\xCF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="150";"subkey"="8";"value"="zzz"}; +{"_yql_column_0"="\xE0\xCF\xC8\xCA\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="075";"subkey"="1";"value"="abc"}; +{"_yql_column_0"="\xE0\xCF\xCC\xC8\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="037";"subkey"="5";"value"="ddd"}; +{"_yql_column_0"="\xE0\xCF\xCD\xCC\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";"key"="023";"subkey"="3";"value"="aaa"}; diff --git a/yql/essentials/tests/sql/suites/table_range/sorted_desc.txt.attr b/yql/essentials/tests/sql/suites/table_range/sorted_desc.txt.attr new file mode 100644 index 0000000000..5a6ca5761e --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/sorted_desc.txt.attr @@ -0,0 +1,47 @@ +{ + "_yql_row_spec" = { + "SortMembers" = [ + "key" + ]; + "SortDirections" = [ + 0 + ]; + "UniqueKeys" = %false; + "SortedByTypes" = [ + [ + "DataType"; + "String" + ] + ]; + "StrictSchema" = %true; + "Type" = [ + "StructType"; + [ + [ + "key"; + [ + "DataType"; + "String" + ] + ]; + [ + "subkey"; + [ + "DataType"; + "String" + ] + ]; + [ + "value"; + [ + "DataType"; + "String" + ] + ] + ] + ]; + "SortedBy" = [ + "_yql_column_0" + ] + } +}
\ No newline at end of file diff --git a/yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt b/yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt new file mode 100644 index 0000000000..1fa10bf270 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt @@ -0,0 +1,4 @@ +{"key"="020";"subkey"="3";"value2"="q"}; +{"key"="075";"subkey"="1";"value2"="abc"}; +{"key"="150";"subkey"="4";"value2"="qzz"}; +{"key"="800";"subkey"="2";"value2"="ddd"}; diff --git a/yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt.attr b/yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt.attr new file mode 100644 index 0000000000..a932faecd8 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/sorted_non_strict.txt.attr @@ -0,0 +1,15 @@ +{ + "schema" = <"strict" = %false; "unique_keys" = %false> + [ + { + "name" = "key"; + "type" = "string"; + "sort_order" = "ascending"; + }; + { + "name" = "subkey"; + "type" = "string"; + "sort_order" = "ascending"; + } + ] +} diff --git a/yql/essentials/tests/sql/suites/table_range/table_funcs_expr.cfg b/yql/essentials/tests/sql/suites/table_range/table_funcs_expr.cfg new file mode 100644 index 0000000000..4464fb271c --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/table_funcs_expr.cfg @@ -0,0 +1,5 @@ +in Input input.txt +udf re2_udf +udf hyperscan_udf +udf string_udf + diff --git a/yql/essentials/tests/sql/suites/table_range/table_funcs_expr.sql b/yql/essentials/tests/sql/suites/table_range/table_funcs_expr.sql new file mode 100644 index 0000000000..0ca6068d44 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/table_funcs_expr.sql @@ -0,0 +1,16 @@ +/* postgres can not */ +/* syntax version 1 */ +use plato; +select count(*) from concat("Inp"||Unicode::ToLower("ut"u)); +select count(*) from concat_strict("Inp"||Unicode::ToLower("ut"u)); +select count(*) from range("","Inp" || Unicode::ToLower("ut"u)); +select count(*) from range_strict("","Inp" || Unicode::ToLower("ut"u)); +select count(*) from filter("",($x)->{return $x == "Input"}); +select count(*) from filter_strict("",($x)->{return $x == "Input"}); +select count(*) from like("","Inp" || "%"); +select count(*) from like_strict("","Inp" || "%"); +select count(*) from regexp("","Inp" || ".t"); +select count(*) from regexp_strict("","Inp" || ".t"); +select count(*) from each(AsList("Input")); +select count(*) from each_strict(AsList("Input")); +select count(*) from folder(SUBSTRING("foo",0,0)); diff --git a/yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.cfg b/yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.cfg new file mode 100644 index 0000000000..51e035b460 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.cfg @@ -0,0 +1,3 @@ +in Input1 input.txt +in Input2 nonexist.txt +in Input3 nonexist.txt diff --git a/yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.sql b/yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.sql new file mode 100644 index 0000000000..f6a46792fc --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/tablepath_with_non_existing.sql @@ -0,0 +1,6 @@ +/* syntax version 1 */ +/* kikimr can not - range not supported */ +USE plato; +SELECT key, subkey, TableName() AS name +FROM each(["Input1", "Input2", "Input3"]) +WITH SCHEMA Struct<key:String, subkey:String, value:String>; diff --git a/yql/essentials/tests/sql/suites/table_range/view_input.txt b/yql/essentials/tests/sql/suites/table_range/view_input.txt new file mode 100644 index 0000000000..df76c64125 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/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/table_range/view_input.txt.attr b/yql/essentials/tests/sql/suites/table_range/view_input.txt.attr new file mode 100644 index 0000000000..07386c98e5 --- /dev/null +++ b/yql/essentials/tests/sql/suites/table_range/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" + ] + ] + ] + ] + } +} |