aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/column_group
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/column_group
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/column_group')
-rw-r--r--yql/essentials/tests/sql/suites/column_group/default.cfg3
-rw-r--r--yql/essentials/tests/sql/suites/column_group/groups-lookup.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/groups-max.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/groups-perusage.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/groups-single.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/groups.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint-disable.cfg8
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint-perusage.cfg8
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint-single.cfg8
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint.sql20
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon-disable.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon-perusage.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon-single.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon.sql9
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon_groups-disable.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon_groups-perusage.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon_groups-single.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_anon_groups.sql9
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_append_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_append_fail.sql5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.sql9
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.sql7
-rw-r--r--yql/essentials/tests/sql/suites/column_group/input.txt2
-rw-r--r--yql/essentials/tests/sql/suites/column_group/input.txt.attr10
-rw-r--r--yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.sql14
-rw-r--r--yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.sql14
-rw-r--r--yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.sql6
-rw-r--r--yql/essentials/tests/sql/suites/column_group/length-perusage.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/length-single.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/length.sql7
-rw-r--r--yql/essentials/tests/sql/suites/column_group/many_inserts.cfg4
-rw-r--r--yql/essentials/tests/sql/suites/column_group/many_inserts.sql32
-rw-r--r--yql/essentials/tests/sql/suites/column_group/min_group.sql8
-rw-r--r--yql/essentials/tests/sql/suites/column_group/publish-perusage.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/publish-single.cfg5
-rw-r--r--yql/essentials/tests/sql/suites/column_group/publish.sql8
57 files changed, 375 insertions, 0 deletions
diff --git a/yql/essentials/tests/sql/suites/column_group/default.cfg b/yql/essentials/tests/sql/suites/column_group/default.cfg
new file mode 100644
index 0000000000..ef47dfff66
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/default.cfg
@@ -0,0 +1,3 @@
+in Input input.txt
+providers yt
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/groups-lookup.cfg b/yql/essentials/tests/sql/suites/column_group/groups-lookup.cfg
new file mode 100644
index 0000000000..5bd531763a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/groups-lookup.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="lookup"
diff --git a/yql/essentials/tests/sql/suites/column_group/groups-max.cfg b/yql/essentials/tests/sql/suites/column_group/groups-max.cfg
new file mode 100644
index 0000000000..dd3af3af12
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/groups-max.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.MaxColumnGroups="2"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/groups-perusage.cfg b/yql/essentials/tests/sql/suites/column_group/groups-perusage.cfg
new file mode 100644
index 0000000000..be63fb17e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/groups-perusage.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/groups-single.cfg b/yql/essentials/tests/sql/suites/column_group/groups-single.cfg
new file mode 100644
index 0000000000..0ccae305ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/groups-single.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="single"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/groups.sql b/yql/essentials/tests/sql/suites/column_group/groups.sql
new file mode 100644
index 0000000000..fe8ebf9ce9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/groups.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+$i = select * from Input where a > "a";
+
+select a,b,c,d from $i;
+select c,d,e,f from $i;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint-disable.cfg b/yql/essentials/tests/sql/suites/column_group/hint-disable.cfg
new file mode 100644
index 0000000000..eb97f5b81d
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint-disable.cfg
@@ -0,0 +1,8 @@
+in Input input.txt
+out Output1 output1.txt
+out Output2 output2.txt
+out Output3 output3.txt
+out Output4 output4.txt
+providers yt
+pragma yt.ColumnGroupMode="disable"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint-perusage.cfg b/yql/essentials/tests/sql/suites/column_group/hint-perusage.cfg
new file mode 100644
index 0000000000..c426193038
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint-perusage.cfg
@@ -0,0 +1,8 @@
+in Input input.txt
+out Output1 output1.txt
+out Output2 output2.txt
+out Output3 output3.txt
+out Output4 output4.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint-single.cfg b/yql/essentials/tests/sql/suites/column_group/hint-single.cfg
new file mode 100644
index 0000000000..2aab65b91e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint-single.cfg
@@ -0,0 +1,8 @@
+in Input input.txt
+out Output1 output1.txt
+out Output2 output2.txt
+out Output3 output3.txt
+out Output4 output4.txt
+providers yt
+pragma yt.ColumnGroupMode="single"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint.sql b/yql/essentials/tests/sql/suites/column_group/hint.sql
new file mode 100644
index 0000000000..5a04cc74f0
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint.sql
@@ -0,0 +1,20 @@
+USE plato;
+
+$i1 = select * from Input where a > "a"; -- several publish consumers with same groups
+$i2 = select * from Input where a > "a1"; -- several publish consumers with different groups
+$i3 = select * from Input where a < "a2"; -- several consumers including publish
+$i4 = select * from Input where a != "a"; -- several publish consumers with and without groups
+
+-- test column group spec normalization
+insert into Output1 with column_groups="{g1=[a;b;c];def=#}" select * from $i1;
+insert into Output1 with column_groups="{def=#;g1=[c;a;b];}" select * from $i2;
+
+insert into Output2 with column_groups="{def=#}" select * from $i2;
+insert into Output2 with column_groups="{def=#}" select * from $i3;
+
+insert into Output3 with column_groups="{g1=[a;b;c];def=#}" select * from $i1;
+insert into Output3 with column_groups="{g1=[a;b;c];def=#}" select * from $i4;
+
+insert into Output4 select * from $i4;
+
+select a,b,c,d from $i3;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon-disable.cfg b/yql/essentials/tests/sql/suites/column_group/hint_anon-disable.cfg
new file mode 100644
index 0000000000..648ff62ddc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon-disable.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="disable"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon-perusage.cfg b/yql/essentials/tests/sql/suites/column_group/hint_anon-perusage.cfg
new file mode 100644
index 0000000000..be63fb17e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon-perusage.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon-single.cfg b/yql/essentials/tests/sql/suites/column_group/hint_anon-single.cfg
new file mode 100644
index 0000000000..0ccae305ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon-single.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="single"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon.sql b/yql/essentials/tests/sql/suites/column_group/hint_anon.sql
new file mode 100644
index 0000000000..b1d85f2d15
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+$i = select * from Input where a > "a";
+
+select a,b,c,d from $i;
+select c,d,e,f from $i;
+
+-- Forces single group for $i
+insert into @tmp select * from $i;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-disable.cfg b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-disable.cfg
new file mode 100644
index 0000000000..648ff62ddc
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-disable.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="disable"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-perusage.cfg b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-perusage.cfg
new file mode 100644
index 0000000000..be63fb17e4
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-perusage.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-single.cfg b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-single.cfg
new file mode 100644
index 0000000000..0ccae305ff
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups-single.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+providers yt
+pragma yt.ColumnGroupMode="single"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_anon_groups.sql b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups.sql
new file mode 100644
index 0000000000..384dbcfd3b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_anon_groups.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+$i = select * from Input where a > "a";
+
+select a,b,c,d from $i;
+select c,d,e,f from $i;
+
+-- Forces specific group for $i
+insert into @tmp with column_groups="{grp=[b;c;d]}" select * from $i;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_append_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_append_fail.cfg
new file mode 100644
index 0000000000..f508c61b27
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_append_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output input.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_append_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_append_fail.sql
new file mode 100644
index 0000000000..2317d88dd2
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_append_fail.sql
@@ -0,0 +1,5 @@
+USE plato;
+
+insert into Output
+with column_groups="{g1=[a;b];def=#}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.sql
new file mode 100644
index 0000000000..9eaa116ad5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_diff_grp_fail.sql
@@ -0,0 +1,9 @@
+USE plato;
+
+insert into Output
+with column_groups="{g1=[a;b];def=#}"
+select * from Input;
+
+insert into Output
+with column_groups="{g1=[c;d];def=#}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.sql
new file mode 100644
index 0000000000..e40a0624f9
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_dup_col_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- duplicate column
+insert into Output
+with column_groups="{g1=[a;a;b];def=#}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.sql
new file mode 100644
index 0000000000..445ed03645
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_dup_def_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- duplicate column
+insert into Output
+with column_groups="{def1=#;def2=#}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.sql
new file mode 100644
index 0000000000..30067b1ded
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_empty_grp_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- empty group
+insert into Output
+with column_groups="{g1=[];def=#}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.sql
new file mode 100644
index 0000000000..e7d630bfea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_lst_yson_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- bad yson
+insert into Output
+with column_groups=@@{g1="a"}@@
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.sql
new file mode 100644
index 0000000000..295f9ecf61
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_map_yson_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- bad yson
+insert into Output
+with column_groups="[abc]"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.sql
new file mode 100644
index 0000000000..35fb731190
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_str_yson_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- bad yson
+insert into Output
+with column_groups="{g1=[3;a]}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.sql
new file mode 100644
index 0000000000..c2a36824dd
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_non_yson_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- bad yson
+insert into Output
+with column_groups="!"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.sql
new file mode 100644
index 0000000000..febf511fbe
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_short_grp_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+-- too short group
+insert into Output
+with column_groups="{g1=[a];def=#}"
+select * from Input;
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.cfg b/yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.cfg
new file mode 100644
index 0000000000..f5c8eefa7e
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
diff --git a/yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.sql b/yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.sql
new file mode 100644
index 0000000000..ebd127dbf3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/hint_unk_col_fail.sql
@@ -0,0 +1,7 @@
+USE plato;
+
+-- unknown column
+insert into Output
+with column_groups="{g1=[l;b;c];def=#}"
+select * from Input;
+
diff --git a/yql/essentials/tests/sql/suites/column_group/input.txt b/yql/essentials/tests/sql/suites/column_group/input.txt
new file mode 100644
index 0000000000..c5e5b75ec5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/input.txt
@@ -0,0 +1,2 @@
+{"a"="a1";"b"="b1";"c"="c1";"d"="d1";"e"="e1";"f"="f1"};
+{"a"="a2";"b"="b2";"c"="c2";"d"="d2";"e"="e2";"f"="f2"};
diff --git a/yql/essentials/tests/sql/suites/column_group/input.txt.attr b/yql/essentials/tests/sql/suites/column_group/input.txt.attr
new file mode 100644
index 0000000000..b337b62c6b
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/input.txt.attr
@@ -0,0 +1,10 @@
+{"_yql_row_spec"={
+ "Type"=["StructType";[
+ ["a";["DataType";"String"]];
+ ["b";["DataType";"String"]];
+ ["c";["DataType";"String"]];
+ ["d";["DataType";"String"]];
+ ["e";["DataType";"String"]];
+ ["f";["DataType";"String"]];
+ ]];
+}}
diff --git a/yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.cfg b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.cfg
new file mode 100644
index 0000000000..351cce8968
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.cfg
@@ -0,0 +1,4 @@
+xfail
+in Input input.txt
+providers yt
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.sql b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.sql
new file mode 100644
index 0000000000..f429533a41
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups1_fail.sql
@@ -0,0 +1,14 @@
+USE plato;
+
+pragma yt.ColumnGroupMode="perusage";
+
+$s1 = select * from Input where a != "";
+$s2 = select * from Input where a > "a1";
+
+insert into @a
+select * from $s1;
+
+commit;
+
+insert into @a with column_groups="{a=#}"
+select * from $s2;
diff --git a/yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.cfg b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.cfg
new file mode 100644
index 0000000000..ab4dec69ea
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.sql b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.sql
new file mode 100644
index 0000000000..2646c4cfe3
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups2_fail.sql
@@ -0,0 +1,14 @@
+USE plato;
+
+pragma yt.ColumnGroupMode="perusage";
+
+$s1 = select * from Input where a != "";
+$s2 = select * from Input where a > "a1";
+
+insert into Output
+select * from $s1;
+
+commit;
+
+insert into Output with column_groups="{a=#}"
+select * from $s2;
diff --git a/yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.cfg b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.cfg
new file mode 100644
index 0000000000..356863d2ae
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.cfg
@@ -0,0 +1,5 @@
+xfail
+in Input input.txt
+out Output input.txt
+providers yt
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.sql b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.sql
new file mode 100644
index 0000000000..5f09a1e177
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/insert_diff_groups3_fail.sql
@@ -0,0 +1,6 @@
+USE plato;
+
+pragma yt.ColumnGroupMode="perusage";
+
+insert into Output with column_groups="{a=#}"
+select * from Input where a != "";
diff --git a/yql/essentials/tests/sql/suites/column_group/length-perusage.cfg b/yql/essentials/tests/sql/suites/column_group/length-perusage.cfg
new file mode 100644
index 0000000000..eaefb06bd5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/length-perusage.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/length-single.cfg b/yql/essentials/tests/sql/suites/column_group/length-single.cfg
new file mode 100644
index 0000000000..c48072ee21
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/length-single.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="single"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/length.sql b/yql/essentials/tests/sql/suites/column_group/length.sql
new file mode 100644
index 0000000000..85ef54124a
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/length.sql
@@ -0,0 +1,7 @@
+USE plato;
+
+$i = select * from Input where a > "a";
+
+select a,b,c,d from $i;
+select c,d,e,f from $i;
+select count(*) from $i;
diff --git a/yql/essentials/tests/sql/suites/column_group/many_inserts.cfg b/yql/essentials/tests/sql/suites/column_group/many_inserts.cfg
new file mode 100644
index 0000000000..4a98bc6feb
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/many_inserts.cfg
@@ -0,0 +1,4 @@
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/many_inserts.sql b/yql/essentials/tests/sql/suites/column_group/many_inserts.sql
new file mode 100644
index 0000000000..b0ead4fad6
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/many_inserts.sql
@@ -0,0 +1,32 @@
+USE plato;
+
+pragma yt.ColumnGroupMode="perusage";
+
+$s1 = select * from Input where a != "";
+$s2 = select * from Input where a > "a1";
+
+insert into @a with column_groups="{a=#}"
+select * from $s1;
+
+insert into @b
+select * from $s1;
+
+insert into @c
+select * from $s1;
+
+insert into Output with column_groups="{a=#}"
+select * from $s1;
+
+commit;
+
+insert into @a with column_groups="{a=#}"
+select * from $s2;
+
+insert into @b
+select * from $s2;
+
+insert into @c with column_groups="{default=#}"
+select * from $s2;
+
+insert into Output with column_groups="{a=#}"
+select * from $s2;
diff --git a/yql/essentials/tests/sql/suites/column_group/min_group.sql b/yql/essentials/tests/sql/suites/column_group/min_group.sql
new file mode 100644
index 0000000000..f99d380f15
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/min_group.sql
@@ -0,0 +1,8 @@
+USE plato;
+pragma yt.MinColumnGroupSize="3";
+pragma yt.ColumnGroupMode="perusage";
+
+$i = select * from Input where a > "a";
+
+select a,b from $i;
+select c,d,e,f from $i;
diff --git a/yql/essentials/tests/sql/suites/column_group/publish-perusage.cfg b/yql/essentials/tests/sql/suites/column_group/publish-perusage.cfg
new file mode 100644
index 0000000000..eaefb06bd5
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/publish-perusage.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="perusage"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/publish-single.cfg b/yql/essentials/tests/sql/suites/column_group/publish-single.cfg
new file mode 100644
index 0000000000..c48072ee21
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/publish-single.cfg
@@ -0,0 +1,5 @@
+in Input input.txt
+out Output output.txt
+providers yt
+pragma yt.ColumnGroupMode="single"
+pragma yt.OptimizeFor="scan"
diff --git a/yql/essentials/tests/sql/suites/column_group/publish.sql b/yql/essentials/tests/sql/suites/column_group/publish.sql
new file mode 100644
index 0000000000..d9f7b9e855
--- /dev/null
+++ b/yql/essentials/tests/sql/suites/column_group/publish.sql
@@ -0,0 +1,8 @@
+USE plato;
+
+$i = select * from Input where a > "a";
+
+select a,b,c,d from $i;
+select c,d,e,f from $i;
+
+insert into Output select * from $i;