aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/file
diff options
context:
space:
mode:
authorMaxim Yurchuk <maxim-yurchuk@ydb.tech>2024-11-20 17:37:57 +0000
committerGitHub <noreply@github.com>2024-11-20 17:37:57 +0000
commitf76323e9b295c15751e51e3443aa47a36bee8023 (patch)
tree4113c8cad473a33e0f746966e0cf087252fa1d7a /yql/essentials/tests/sql/suites/file
parent753ecb8d410a4cb459c26f3a0082fb2d1724fe63 (diff)
parenta7b9a6afea2a9d7a7bfac4c5eb4c1a8e60adb9e6 (diff)
downloadydb-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/file')
-rw-r--r--yql/essentials/tests/sql/suites/file/bools.lst8
-rw-r--r--yql/essentials/tests/sql/suites/file/file_constness.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/file_constness.sql6
-rw-r--r--yql/essentials/tests/sql/suites/file/file_list_bools.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/file/file_list_bools.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/file_list_simple.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/file/file_list_simple.sql4
-rw-r--r--yql/essentials/tests/sql/suites/file/file_skip_take.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/file/file_skip_take.sql10
-rw-r--r--yql/essentials/tests/sql/suites/file/input_intersect.txt14
-rw-r--r--yql/essentials/tests/sql/suites/file/keyid.lst7
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/file/where_key_in_file_content.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/where_key_in_file_content.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.sql2
-rw-r--r--yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.sql4
27 files changed, 108 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/file/bools.lst b/yql/essentials/tests/sql/suites/file/bools.lst
new file mode 100644
index 0000000000..f811fea266
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/bools.lst
@@ -0,0 +1,8 @@
+0
+1
+1
+false
+0
+1
+true
+0
diff --git a/yql/essentials/tests/sql/suites/file/file_constness.cfg b/yql/essentials/tests/sql/suites/file/file_constness.cfg
new file mode 100644
index 0000000000..34dab9d3e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_constness.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf
diff --git a/yql/essentials/tests/sql/suites/file/file_constness.sql b/yql/essentials/tests/sql/suites/file/file_constness.sql
new file mode 100644
index 0000000000..b0adb1b5ee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_constness.sql
@@ -0,0 +1,6 @@
+/* postgres can not */
+/* syntax version 1 */
+select key,
+ FileContent("keyid.lst") as content,
+ ListCollect(ParseFile('int32', "keyid.lst")) as content_list,
+from plato.Input group by key order by key;
diff --git a/yql/essentials/tests/sql/suites/file/file_list_bools.cfg b/yql/essentials/tests/sql/suites/file/file_list_bools.cfg
new file mode 100644
index 0000000000..b921413da2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_list_bools.cfg
@@ -0,0 +1,2 @@
+file bools.lst bools.lst
+udf file_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/file/file_list_bools.sql b/yql/essentials/tests/sql/suites/file/file_list_bools.sql
new file mode 100644
index 0000000000..40ef4be536
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_list_bools.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select ParseFile('bool', "bools.lst");
diff --git a/yql/essentials/tests/sql/suites/file/file_list_simple.cfg b/yql/essentials/tests/sql/suites/file/file_list_simple.cfg
new file mode 100644
index 0000000000..9756b704ec
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_list_simple.cfg
@@ -0,0 +1,4 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf
+udf string_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/file/file_list_simple.sql b/yql/essentials/tests/sql/suites/file/file_list_simple.sql
new file mode 100644
index 0000000000..aabaacc753
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_list_simple.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* syntax version 1 */
+-- compiles to different code in v0/v1 due to different SplitToList settings
+select * from plato.Input where key in String::SplitToList(FileContent("keyid.lst"), "\n", true);
diff --git a/yql/essentials/tests/sql/suites/file/file_skip_take.cfg b/yql/essentials/tests/sql/suites/file/file_skip_take.cfg
new file mode 100644
index 0000000000..2397b1c376
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_skip_take.cfg
@@ -0,0 +1,2 @@
+file keyid.lst keyid.lst
+udf file_udf
diff --git a/yql/essentials/tests/sql/suites/file/file_skip_take.sql b/yql/essentials/tests/sql/suites/file/file_skip_take.sql
new file mode 100644
index 0000000000..640db2185e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/file_skip_take.sql
@@ -0,0 +1,10 @@
+/* postgres can not */
+/* syntax version 1 */
+$file = ParseFile("String", "keyid.lst");
+
+$file = ListTake(ListSkip($file, 3ul), 2ul);
+
+$file = EvaluateExpr($file);
+
+select $file;
+
diff --git a/yql/essentials/tests/sql/suites/file/input_intersect.txt b/yql/essentials/tests/sql/suites/file/input_intersect.txt
new file mode 100644
index 0000000000..42bcf2179e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/input_intersect.txt
@@ -0,0 +1,14 @@
+{"key"="075";"subkey"="911";"value"="abc"};
+{"key"="911";"subkey"="1";"value"="kkk"};
+{"key"="023";"subkey"="527";"value"="aaa"};
+{"key"="527";"subkey"="023";"value"="bbb"};
+{"key"="037";"subkey"="075";"value"="ddd"};
+{"key"="761";"subkey"="911";"value"="ccc"};
+{"key"="200";"subkey"="075";"value"="qqq"};
+{"key"="150";"subkey"="075";"value"="zzz"};
+{"key"="023";"subkey"="911";"value"="vca"};
+{"key"="527";"subkey"="150";"value"="oef"};
+{"key"="037";"subkey"="761";"value"="vdf"};
+{"key"="761";"subkey"="037";"value"="aet"};
+{"key"="200";"subkey"="150";"value"="fdb"};
+{"key"="150";"subkey"="037";"value"="bfs"};
diff --git a/yql/essentials/tests/sql/suites/file/keyid.lst b/yql/essentials/tests/sql/suites/file/keyid.lst
new file mode 100644
index 0000000000..5c9644f627
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/keyid.lst
@@ -0,0 +1,7 @@
+911
+884
+350
+23
+150
+200
+250
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.cfg b/yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.cfg
new file mode 100644
index 0000000000..a01a1a3d24
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+file keyid.lst keyid.lst
+udf file_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.sql b/yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.sql
new file mode 100644
index 0000000000..2a47763852
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_bad_type_fail.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select ParseFile('uuid', "keyid.lst");
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.cfg b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.cfg
new file mode 100644
index 0000000000..0b503dd816
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.sql b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.sql
new file mode 100644
index 0000000000..ca58dc1af0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_int.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select key, value, cast(key as int32) ?? 0 in ParseFile('int32', "keyid.lst") as privilege from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.cfg b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.cfg
new file mode 100644
index 0000000000..0b503dd816
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.sql b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.sql
new file mode 100644
index 0000000000..47bf7969a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_str.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select key, value, key in ParseFile('string', "keyid.lst") as privilege from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.cfg b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.cfg
new file mode 100644
index 0000000000..34dab9d3e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf
diff --git a/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.sql b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.sql
new file mode 100644
index 0000000000..2e1b948ef1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/parse_file_in_select_as_uint64.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select key, value, cast(key as int32) in ParseFile('uint64', "keyid.lst") as privilege from plato.Input;
diff --git a/yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.cfg b/yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.cfg
new file mode 100644
index 0000000000..a3cc236d31
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.cfg
@@ -0,0 +1,3 @@
+xfail
+file keyid.lst keyid.lst
+udf file_udf
diff --git a/yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.sql b/yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.sql
new file mode 100644
index 0000000000..10a2763a86
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/second_pass_parse_file_fail.sql
@@ -0,0 +1,5 @@
+/* postgres can not */
+$list = ParseFile("int32","keyid.lst");
+select ListExtend(
+ ListMap($list, ($x)->{return $x + 1 }),
+ ListMap($list, ($x)->{return $x + 2 })); \ No newline at end of file
diff --git a/yql/essentials/tests/sql/suites/file/where_key_in_file_content.cfg b/yql/essentials/tests/sql/suites/file/where_key_in_file_content.cfg
new file mode 100644
index 0000000000..34dab9d3e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/where_key_in_file_content.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf
diff --git a/yql/essentials/tests/sql/suites/file/where_key_in_file_content.sql b/yql/essentials/tests/sql/suites/file/where_key_in_file_content.sql
new file mode 100644
index 0000000000..12579fbf51
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/where_key_in_file_content.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input where key in ParseFile('String', "keyid.lst");
diff --git a/yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.cfg b/yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.cfg
new file mode 100644
index 0000000000..34dab9d3e0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.cfg
@@ -0,0 +1,3 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf
diff --git a/yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.sql b/yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.sql
new file mode 100644
index 0000000000..337a419ac5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/where_key_in_file_content_typed.sql
@@ -0,0 +1,2 @@
+/* postgres can not */
+select * from plato.Input where cast(key as Uint32) in ParseFile('uint32', "keyid.lst");
diff --git a/yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.cfg b/yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.cfg
new file mode 100644
index 0000000000..9ad7c33313
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.cfg
@@ -0,0 +1,4 @@
+in Input input_intersect.txt
+file keyid.lst keyid.lst
+udf file_udf
+udf string_udf
diff --git a/yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.sql b/yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.sql
new file mode 100644
index 0000000000..aabaacc753
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/file/where_key_in_get_file_content.sql
@@ -0,0 +1,4 @@
+/* postgres can not */
+/* syntax version 1 */
+-- compiles to different code in v0/v1 due to different SplitToList settings
+select * from plato.Input where key in String::SplitToList(FileContent("keyid.lst"), "\n", true);