aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/binding
diff options
context:
space:
mode:
authorudovichenko-r <udovichenko-r@yandex-team.com>2024-11-19 14:58:38 +0300
committerudovichenko-r <udovichenko-r@yandex-team.com>2024-11-19 15:16:27 +0300
commit24521403b1c44303e043ba540c09b1fe991c7474 (patch)
tree341d1e7206bc7c143d04d2d96f05b6dc0655606d /yql/essentials/tests/sql/suites/binding
parent72b3cd51dc3fb9d16975d353ea82fd85701393cc (diff)
downloadydb-24521403b1c44303e043ba540c09b1fe991c7474.tar.gz
YQL-19206 Move contrib/ydb/library/yql/tests/sql/suites -> yql/essentials/tests/sql/suites
commit_hash:d0ef1f92b09c94db7c2408f946d2a4c62b603f00
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;
+