aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/binding
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/binding
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/binding')
-rw-r--r--yql/essentials/tests/sql/suites/binding/anon_table_binding.sql10
-rw-r--r--yql/essentials/tests/sql/suites/binding/bind_cast.sql4
-rw-r--r--yql/essentials/tests/sql/suites/binding/bind_select.sql5
-rw-r--r--yql/essentials/tests/sql/suites/binding/compact_named_exprs.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/binding/compact_named_exprs.sql8
-rw-r--r--yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.sql27
-rw-r--r--yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.sql16
-rw-r--r--yql/essentials/tests/sql/suites/binding/default.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/binding/drop_binding.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/binding/drop_binding.sql8
-rw-r--r--yql/essentials/tests/sql/suites/binding/input.txt4
-rw-r--r--yql/essentials/tests/sql/suites/binding/input2.txt4
-rw-r--r--yql/essentials/tests/sql/suites/binding/input3.txt7
-rw-r--r--yql/essentials/tests/sql/suites/binding/input4.txt9
-rw-r--r--yql/essentials/tests/sql/suites/binding/insert_binding.cfg2
-rw-r--r--yql/essentials/tests/sql/suites/binding/insert_binding.sql7
-rw-r--r--yql/essentials/tests/sql/suites/binding/named_callable.sql4
-rw-r--r--yql/essentials/tests/sql/suites/binding/named_expr_input.sql4
-rw-r--r--yql/essentials/tests/sql/suites/binding/named_node_corr_names.sql7
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_concat_binding.sql9
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_concat_binding_bad1.sqlx4
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_concat_binding_bad2.sqlx4
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_concat_binding_bad3.sqlx4
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_concat_strict_binding.sql9
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_filter_binding.sql27
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_filter_strict_binding.sql28
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_from_binding.sql5
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_from_binding_bad1.sqlx3
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_from_binding_bad2.sqlx3
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_from_binding_bad3.sqlx3
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_from_binding_bad4.sqlx3
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_from_binding_inferscheme.sql8
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_range_binding.sql46
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_range_strict_binding.sql46
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_regexp_binding.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_regexp_binding.sql17
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.sql17
-rw-r--r--yql/essentials/tests/sql/suites/binding/tie.sql4
-rw-r--r--yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.cfg1
-rw-r--r--yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/binding/tie_scalar_context.sql18
44 files changed, 409 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/binding/anon_table_binding.sql b/yql/essentials/tests/sql/suites/binding/anon_table_binding.sql
new file mode 100644
index 0000000000..95f5f0796f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/anon_table_binding.sql
@@ -0,0 +1,10 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$c = "cccc";
+
+INSERT INTO @$c
+select 1 as x;
+commit;
+SELECT * FROM @$c;
diff --git a/yql/essentials/tests/sql/suites/binding/bind_cast.sql b/yql/essentials/tests/sql/suites/binding/bind_cast.sql
new file mode 100644
index 0000000000..2ccf1cdf6a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/bind_cast.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$casted_null = cast(null as Double);
+select $casted_null
diff --git a/yql/essentials/tests/sql/suites/binding/bind_select.sql b/yql/essentials/tests/sql/suites/binding/bind_select.sql
new file mode 100644
index 0000000000..a7f24466c8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/bind_select.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+$foo = (select 100500 as bar);
+select bar from $foo;
diff --git a/yql/essentials/tests/sql/suites/binding/compact_named_exprs.cfg b/yql/essentials/tests/sql/suites/binding/compact_named_exprs.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/compact_named_exprs.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/binding/compact_named_exprs.sql b/yql/essentials/tests/sql/suites/binding/compact_named_exprs.sql
new file mode 100644
index 0000000000..a6f77687df
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/compact_named_exprs.sql
@@ -0,0 +1,8 @@
+/* yt can not */
+pragma CompactNamedExprs;
+
+$foo = 1+2;
+$a, $b = AsTuple(1+3, 2+5);
+$l = ($x) -> ($x + $foo);
+
+select $foo, $a, $b, $l(123);
diff --git a/yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.cfg b/yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.sql b/yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.sql
new file mode 100644
index 0000000000..a823be2af3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/compact_named_subq_actions.sql
@@ -0,0 +1,27 @@
+pragma CompactNamedExprs;
+
+$src = select 1;
+
+define subquery $sub1() as
+ select * from $src;
+end define;
+
+$foo = 1+2;
+
+define subquery $sub2($sub, $extra) as
+ select a.*, $extra as extra, $foo as another from $sub() as a
+end define;
+
+select * from $sub1();
+select * from $sub2($sub1, 1);
+select * from $sub2($sub1, "aaa");
+
+define action $hello_world($sub, $name, $suffix?) as
+ $name = $name ?? ($suffix ?? "world");
+ select "Hello, " || $name || "!" from $sub();
+end define;
+
+do empty_action();
+do $hello_world($sub1, null);
+do $hello_world($sub1, null, "John");
+do $hello_world($sub1, null, "Earth");
diff --git a/yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.cfg b/yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.cfg
new file mode 100644
index 0000000000..bb349dd8ab
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.cfg
@@ -0,0 +1 @@
+providers yt
diff --git a/yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.sql b/yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.sql
new file mode 100644
index 0000000000..0da0d7dd97
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/compact_named_with_subq_contexts.sql
@@ -0,0 +1,16 @@
+/* yt can not */
+pragma CompactNamedExprs;
+
+$a = (SELECT CAST(Unicode::ToUpper("o"u) AS String) || "utpu");
+$b = $a || CAST(Unicode::ToLower("T"u) AS String);
+select $b;
+select $a || CAST(Unicode::ToLower("T"u) AS String);
+select * from $a;
+select "Outpu" in $a;
+
+define subquery $sub() as
+ select * from $a;
+end define;
+
+select * from $sub();
+
diff --git a/yql/essentials/tests/sql/suites/binding/default.cfg b/yql/essentials/tests/sql/suites/binding/default.cfg
new file mode 100644
index 0000000000..a1f7a5a9b7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/default.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
diff --git a/yql/essentials/tests/sql/suites/binding/drop_binding.cfg b/yql/essentials/tests/sql/suites/binding/drop_binding.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/drop_binding.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/binding/drop_binding.sql b/yql/essentials/tests/sql/suites/binding/drop_binding.sql
new file mode 100644
index 0000000000..48bafd14d7
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/drop_binding.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - can't drop non-existent table */
+
+USE plato;
+
+$a = "Output";
+DROP TABLE $a;
diff --git a/yql/essentials/tests/sql/suites/binding/input.txt b/yql/essentials/tests/sql/suites/binding/input.txt
new file mode 100644
index 0000000000..65949ea745
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/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/binding/input2.txt b/yql/essentials/tests/sql/suites/binding/input2.txt
new file mode 100644
index 0000000000..5c939cf453
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/input2.txt
@@ -0,0 +1,4 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
diff --git a/yql/essentials/tests/sql/suites/binding/input3.txt b/yql/essentials/tests/sql/suites/binding/input3.txt
new file mode 100644
index 0000000000..48d828f6fd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/input3.txt
@@ -0,0 +1,7 @@
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="30";"value"="BAR"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="A";"subkey"="50";"value"="WAT"};
+{"key"="A";"subkey"="50";"value"="WAT"};
diff --git a/yql/essentials/tests/sql/suites/binding/input4.txt b/yql/essentials/tests/sql/suites/binding/input4.txt
new file mode 100644
index 0000000000..65f33616b2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/input4.txt
@@ -0,0 +1,9 @@
+{"key"="0";"subkey"="10";"value"="FOO"};
+{"key"="0";"subkey"="40";"value"="FOO"};
+{"key"="1";"subkey"="10";"value"="FOO"};
+{"key"="1";"subkey"="20";"value"="BAR"};
+{"key"="1";"subkey"="40";"value"="BAR"};
+{"key"="1";"subkey"="50";"value"="WAT"};
+{"key"="2";"subkey"="40";"value"="WAT"};
+{"key"="2";"subkey"="50";"value"="FOO"};
+{"key"="2";"subkey"="60";"value"="BAR"};
diff --git a/yql/essentials/tests/sql/suites/binding/insert_binding.cfg b/yql/essentials/tests/sql/suites/binding/insert_binding.cfg
new file mode 100644
index 0000000000..ad52c79527
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/insert_binding.cfg
@@ -0,0 +1,2 @@
+in Input input.txt
+out Output output.txt
diff --git a/yql/essentials/tests/sql/suites/binding/insert_binding.sql b/yql/essentials/tests/sql/suites/binding/insert_binding.sql
new file mode 100644
index 0000000000..28f1de7135
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/insert_binding.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$a = "Output";
+INSERT INTO $a
+SELECT count(*) from Input;
diff --git a/yql/essentials/tests/sql/suites/binding/named_callable.sql b/yql/essentials/tests/sql/suites/binding/named_callable.sql
new file mode 100644
index 0000000000..0313023fee
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/named_callable.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$foo = ($item) -> { return $item + $item};
+select $foo(1);
diff --git a/yql/essentials/tests/sql/suites/binding/named_expr_input.sql b/yql/essentials/tests/sql/suites/binding/named_expr_input.sql
new file mode 100644
index 0000000000..f6b63b48a8
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/named_expr_input.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$foo = (select 100500 as bar);
+select bar from $foo;
diff --git a/yql/essentials/tests/sql/suites/binding/named_node_corr_names.sql b/yql/essentials/tests/sql/suites/binding/named_node_corr_names.sql
new file mode 100644
index 0000000000..4b9c0ddbba
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/named_node_corr_names.sql
@@ -0,0 +1,7 @@
+/* syntax version 1 */
+/* postgres can not */
+USE plato;
+
+$a = (SELECT key, subkey FROM Input);
+SELECT a.subkey FROM $a AS a;
+SELECT b.subkey FROM $a AS b;
diff --git a/yql/essentials/tests/sql/suites/binding/table_concat_binding.sql b/yql/essentials/tests/sql/suites/binding/table_concat_binding.sql
new file mode 100644
index 0000000000..0cfc4b4e1a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_concat_binding.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+$a = "Input";
+SELECT count(*) FROM plato.concat($a,$a);
+
+USE plato;
+
+$a = "Input";
+SELECT count(*) FROM concat($a,$a);
diff --git a/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad1.sqlx b/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad1.sqlx
new file mode 100644
index 0000000000..62f609a682
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad1.sqlx
@@ -0,0 +1,4 @@
+/* postgres can not */
+use plato;
+$a = plato.Input;
+SELECT count(*) FROM concat($a,$a);
diff --git a/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad2.sqlx b/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad2.sqlx
new file mode 100644
index 0000000000..90cc8bdb0c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad2.sqlx
@@ -0,0 +1,4 @@
+/* postgres can not */
+use plato;
+$a = a[0];
+SELECT count(*) FROM concat($a,$a);
diff --git a/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad3.sqlx b/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad3.sqlx
new file mode 100644
index 0000000000..11b22f42a1
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_concat_binding_bad3.sqlx
@@ -0,0 +1,4 @@
+/* postgres can not */
+use plato;
+$a = a.0;
+SELECT count(*) FROM concat($a,$a);
diff --git a/yql/essentials/tests/sql/suites/binding/table_concat_strict_binding.sql b/yql/essentials/tests/sql/suites/binding/table_concat_strict_binding.sql
new file mode 100644
index 0000000000..ba55ba86ac
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_concat_strict_binding.sql
@@ -0,0 +1,9 @@
+/* syntax version 1 */
+/* postgres can not */
+$a = "Input";
+SELECT count(*) FROM plato.concat_strict($a,$a);
+
+USE plato;
+
+$a = "Input";
+SELECT count(*) FROM concat_strict($a,$a);
diff --git a/yql/essentials/tests/sql/suites/binding/table_filter_binding.sql b/yql/essentials/tests/sql/suites/binding/table_filter_binding.sql
new file mode 100644
index 0000000000..76aa156f96
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_filter_binding.sql
@@ -0,0 +1,27 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - range not supported */
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "";
+SELECT count(*) FROM plato.filter($a,$b,$c,$d);
+
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "raw";
+SELECT count(*) FROM plato.filter($a,$b,$c,$d);
+
+use plato;
+
+$b = ($_item)->{return true;};
+$c = "";
+$d = "";
+SELECT count(*) FROM filter($a,$b,$c,$d);
+
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "raw";
+SELECT count(*) FROM filter($a,$b,$c,$d);
diff --git a/yql/essentials/tests/sql/suites/binding/table_filter_strict_binding.sql b/yql/essentials/tests/sql/suites/binding/table_filter_strict_binding.sql
new file mode 100644
index 0000000000..0217520a0f
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_filter_strict_binding.sql
@@ -0,0 +1,28 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - range not supported */
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "";
+SELECT count(*) FROM plato.filter_strict($a,$b,$c,$d);
+
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "raw";
+SELECT count(*) FROM plato.filter_strict($a,$b,$c,$d);
+
+use plato;
+
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "";
+SELECT count(*) FROM filter_strict($a,$b,$c,$d);
+
+$a = "";
+$b = ($_item)->{return true;};
+$c = "";
+$d = "raw";
+SELECT count(*) FROM filter_strict($a,$b,$c,$d);
diff --git a/yql/essentials/tests/sql/suites/binding/table_from_binding.sql b/yql/essentials/tests/sql/suites/binding/table_from_binding.sql
new file mode 100644
index 0000000000..0ea49f5ee5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_from_binding.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+use plato;
+$x = "Input";
+SELECT count(*) FROM $x;
diff --git a/yql/essentials/tests/sql/suites/binding/table_from_binding_bad1.sqlx b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad1.sqlx
new file mode 100644
index 0000000000..41d8d01426
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad1.sqlx
@@ -0,0 +1,3 @@
+/* postgres can not */
+$x = a.0;
+SELECT count(*) FROM $x as a;
diff --git a/yql/essentials/tests/sql/suites/binding/table_from_binding_bad2.sqlx b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad2.sqlx
new file mode 100644
index 0000000000..334d1dcd5c
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad2.sqlx
@@ -0,0 +1,3 @@
+/* postgres can not */
+$x = a[0];
+SELECT count(*) FROM $x;
diff --git a/yql/essentials/tests/sql/suites/binding/table_from_binding_bad3.sqlx b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad3.sqlx
new file mode 100644
index 0000000000..346c86cb92
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad3.sqlx
@@ -0,0 +1,3 @@
+/* postgres can not */
+$x = a.b[0];
+SELECT count(*) FROM $x;
diff --git a/yql/essentials/tests/sql/suites/binding/table_from_binding_bad4.sqlx b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad4.sqlx
new file mode 100644
index 0000000000..cb7384a5ca
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_from_binding_bad4.sqlx
@@ -0,0 +1,3 @@
+/* postgres can not */
+$x = a.b;
+SELECT count(*) FROM $x;
diff --git a/yql/essentials/tests/sql/suites/binding/table_from_binding_inferscheme.sql b/yql/essentials/tests/sql/suites/binding/table_from_binding_inferscheme.sql
new file mode 100644
index 0000000000..1e2bd7c935
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_from_binding_inferscheme.sql
@@ -0,0 +1,8 @@
+/* syntax version 1 */
+/* kikimr can not */
+pragma yt.InferSchema;
+
+/* postgres can not */
+use plato;
+$x = "Input";
+SELECT count(*) FROM $x;
diff --git a/yql/essentials/tests/sql/suites/binding/table_range_binding.sql b/yql/essentials/tests/sql/suites/binding/table_range_binding.sql
new file mode 100644
index 0000000000..4669fb2077
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_range_binding.sql
@@ -0,0 +1,46 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - range not supported */
+$a = "";
+$b = "Input";
+$c = "Input";
+$d = "";
+$e = "";
+SELECT count(*) FROM plato.range($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input1";
+$d = "";
+$e = "raw";
+SELECT count(*) FROM plato.range($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input2";
+$d = "";
+$e = "";
+SELECT count(*) FROM plato.range($a,$b,$c,$d,$e);
+
+use plato;
+
+$a = "";
+$b = "Input";
+$c = "Input";
+$d = "";
+$e = "";
+SELECT count(*) FROM range($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input1";
+$d = "";
+$e = "raw";
+SELECT count(*) FROM range($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input2";
+$d = "";
+$e = "";
+SELECT count(*) FROM range($a,$b,$c,$d,$e);
diff --git a/yql/essentials/tests/sql/suites/binding/table_range_strict_binding.sql b/yql/essentials/tests/sql/suites/binding/table_range_strict_binding.sql
new file mode 100644
index 0000000000..bbf62c6c2a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_range_strict_binding.sql
@@ -0,0 +1,46 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - range_strict not supported */
+$a = "";
+$b = "Input";
+$c = "Input";
+$d = "";
+$e = "";
+SELECT count(*) FROM plato.range_strict($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input1";
+$d = "";
+$e = "raw";
+SELECT count(*) FROM plato.range_strict($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input2";
+$d = "";
+$e = "";
+SELECT count(*) FROM plato.range_strict($a,$b,$c,$d,$e);
+
+use plato;
+
+$a = "";
+$b = "Input";
+$c = "Input";
+$d = "";
+$e = "";
+SELECT count(*) FROM range_strict($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input1";
+$d = "";
+$e = "raw";
+SELECT count(*) FROM range_strict($a,$b,$c,$d,$e);
+
+$a = "";
+$b = "Inp";
+$c = "Input2";
+$d = "";
+$e = "";
+SELECT count(*) FROM range_strict($a,$b,$c,$d,$e);
diff --git a/yql/essentials/tests/sql/suites/binding/table_regexp_binding.cfg b/yql/essentials/tests/sql/suites/binding/table_regexp_binding.cfg
new file mode 100644
index 0000000000..acaecd1e1d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_regexp_binding.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+udf pire_udf
diff --git a/yql/essentials/tests/sql/suites/binding/table_regexp_binding.sql b/yql/essentials/tests/sql/suites/binding/table_regexp_binding.sql
new file mode 100644
index 0000000000..2e3d721dc6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_regexp_binding.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - range not supported */
+
+$a = "";
+$b = "Input";
+$c = "";
+$d = "";
+SELECT count(*) FROM plato.regexp($a,$b,$c,$d);
+
+use plato;
+
+$a = "";
+$b = "Input";
+$c = "";
+$d = "";
+SELECT count(*) FROM regexp($a,$b,$c,$d);
diff --git a/yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.cfg b/yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.cfg
new file mode 100644
index 0000000000..acaecd1e1d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+in Input2 input2.txt
+in Input3 input3.txt
+in Input4 input4.txt
+udf pire_udf
diff --git a/yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.sql b/yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.sql
new file mode 100644
index 0000000000..530b988012
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/table_regexp_strict_binding.sql
@@ -0,0 +1,17 @@
+/* syntax version 1 */
+/* postgres can not */
+/* kikimr can not - range not supported */
+
+$a = "";
+$b = "Input";
+$c = "";
+$d = "";
+SELECT count(*) FROM plato.regexp_strict($a,$b,$c,$d);
+
+use plato;
+
+$a = "";
+$b = "Input";
+$c = "";
+$d = "";
+SELECT count(*) FROM regexp_strict($a,$b,$c,$d);
diff --git a/yql/essentials/tests/sql/suites/binding/tie.sql b/yql/essentials/tests/sql/suites/binding/tie.sql
new file mode 100644
index 0000000000..fe867ff709
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/tie.sql
@@ -0,0 +1,4 @@
+/* syntax version 1 */
+/* postgres can not */
+$a, $b, $c = AsTuple(1, 5u, "test");
+select $a, $b, $c;
diff --git a/yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.cfg b/yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.cfg
new file mode 100644
index 0000000000..5dae597903
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.cfg
@@ -0,0 +1 @@
+xfail
diff --git a/yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.sql b/yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.sql
new file mode 100644
index 0000000000..de29966b64
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/tie_bad_count_fail.sql
@@ -0,0 +1,5 @@
+/* syntax version 1 */
+/* postgres can not */
+$i, $j = AsTuple(1, 5u, "test");
+
+select $i, $j;
diff --git a/yql/essentials/tests/sql/suites/binding/tie_scalar_context.sql b/yql/essentials/tests/sql/suites/binding/tie_scalar_context.sql
new file mode 100644
index 0000000000..162de996b0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/binding/tie_scalar_context.sql
@@ -0,0 +1,18 @@
+/* syntax version 1 */
+/* postgres can not */
+
+$foo = ($x) -> {
+ return AsTuple($x, $x);
+};
+
+$ids = (
+ SELECT AGGREGATE_LIST(id)
+ FROM (
+ select "1" as id union all select "2" as id
+ )
+);
+
+
+$first_ids, $second_ids = $foo(unwrap($ids));
+select $first_ids as one, $second_ids as two;
+