summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2025-03-14 18:29:00 +0300
committerrobot-piglet <[email protected]>2025-03-14 18:39:23 +0300
commitfce2a692db534e71e5f317d2f7b40ea89753e187 (patch)
tree76ad1b41b4c4eb77f29ee2e4db19969bb70e48b9
parent4e1f32e79a5e1c6075ec3d9efb456591863c0776 (diff)
Intermediate changes
commit_hash:e4d74265cffda90e1a7a702fed4b2e0dc1225a8c
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_4tables.cfg8
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_4tables_only_sorted_merge.cfg8
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_7tables.cfg8
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_7tables.sql31
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_7tables_only_common_join.cfg8
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_7tables_only_common_join.sql31
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_a.txt (renamed from yt/yql/tests/sql/suites/join/cbo_4tables_a.txt)0
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_a.txt.attr (renamed from yt/yql/tests/sql/suites/join/cbo_4tables_a.txt.attr)0
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_b.txt (renamed from yt/yql/tests/sql/suites/join/cbo_4tables_b.txt)0
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_b.txt.attr (renamed from yt/yql/tests/sql/suites/join/cbo_4tables_b.txt.attr)0
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_c.txt (renamed from yt/yql/tests/sql/suites/join/cbo_4tables_c.txt)0
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_c.txt.attr (renamed from yt/yql/tests/sql/suites/join/cbo_4tables_c.txt.attr)0
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_d.txt (renamed from yt/yql/tests/sql/suites/join/cbo_4tables_d.txt)0
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_d.txt.attr (renamed from yt/yql/tests/sql/suites/join/cbo_4tables_d.txt.attr)0
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_e.txt4
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_e.txt.attr25
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_f.txt6
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_f.txt.attr34
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_g.txt6
-rw-r--r--yt/yql/tests/sql/suites/join/cbo_g.txt.attr45
20 files changed, 206 insertions, 8 deletions
diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables.cfg b/yt/yql/tests/sql/suites/join/cbo_4tables.cfg
index a5101acc8c2..514082c6e4e 100644
--- a/yt/yql/tests/sql/suites/join/cbo_4tables.cfg
+++ b/yt/yql/tests/sql/suites/join/cbo_4tables.cfg
@@ -1,5 +1,5 @@
providers yt
-in InputA cbo_4tables_a.txt
-in InputB cbo_4tables_b.txt
-in InputC cbo_4tables_c.txt
-in InputD cbo_4tables_d.txt
+in InputA cbo_a.txt
+in InputB cbo_b.txt
+in InputC cbo_c.txt
+in InputD cbo_d.txt
diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_only_sorted_merge.cfg b/yt/yql/tests/sql/suites/join/cbo_4tables_only_sorted_merge.cfg
index a5101acc8c2..514082c6e4e 100644
--- a/yt/yql/tests/sql/suites/join/cbo_4tables_only_sorted_merge.cfg
+++ b/yt/yql/tests/sql/suites/join/cbo_4tables_only_sorted_merge.cfg
@@ -1,5 +1,5 @@
providers yt
-in InputA cbo_4tables_a.txt
-in InputB cbo_4tables_b.txt
-in InputC cbo_4tables_c.txt
-in InputD cbo_4tables_d.txt
+in InputA cbo_a.txt
+in InputB cbo_b.txt
+in InputC cbo_c.txt
+in InputD cbo_d.txt
diff --git a/yt/yql/tests/sql/suites/join/cbo_7tables.cfg b/yt/yql/tests/sql/suites/join/cbo_7tables.cfg
new file mode 100644
index 00000000000..0a2474a1858
--- /dev/null
+++ b/yt/yql/tests/sql/suites/join/cbo_7tables.cfg
@@ -0,0 +1,8 @@
+providers yt
+in InputA cbo_a.txt
+in InputB cbo_b.txt
+in InputC cbo_c.txt
+in InputD cbo_d.txt
+in InputE cbo_e.txt
+in InputF cbo_f.txt
+in InputG cbo_g.txt
diff --git a/yt/yql/tests/sql/suites/join/cbo_7tables.sql b/yt/yql/tests/sql/suites/join/cbo_7tables.sql
new file mode 100644
index 00000000000..724cb44869a
--- /dev/null
+++ b/yt/yql/tests/sql/suites/join/cbo_7tables.sql
@@ -0,0 +1,31 @@
+/* ytfile can not */
+USE plato;
+
+pragma CostBasedOptimizer="native";
+pragma yt.MapJoinLimit="1000";
+pragma yt.LookupJoinLimit="1000";
+pragma yt.LookupJoinMaxRows="100";
+pragma yt.ExtendedStatsMaxChunkCount="0";
+pragma yt.JoinMergeTablesLimit="100";
+
+$s = (SELECT InputG.g3 AS g3, COUNT(*) AS cnt FROM
+ InputG
+ INNER JOIN InputF ON InputF.f2 = InputG.g1
+ INNER JOIN InputE ON InputG.g2 = InputE.e1
+ GROUP BY InputG.g3);
+
+SELECT
+ InputA.Key1,
+ InputA.Key2,
+ InputA.Value,
+ InputB.val,
+ InputC.v,
+ InputD.value as vald,
+ s.g3,
+ s.cnt
+FROM
+ InputA
+ INNER JOIN InputC ON InputA.Key1 = InputC.k
+ RIGHT JOIN InputD ON InputA.Key2 = InputD.k
+ RIGHT JOIN InputB ON InputA.Fk1 = InputB.k
+ INNER JOIN $s AS s ON InputD.value = s.g3;
diff --git a/yt/yql/tests/sql/suites/join/cbo_7tables_only_common_join.cfg b/yt/yql/tests/sql/suites/join/cbo_7tables_only_common_join.cfg
new file mode 100644
index 00000000000..0a2474a1858
--- /dev/null
+++ b/yt/yql/tests/sql/suites/join/cbo_7tables_only_common_join.cfg
@@ -0,0 +1,8 @@
+providers yt
+in InputA cbo_a.txt
+in InputB cbo_b.txt
+in InputC cbo_c.txt
+in InputD cbo_d.txt
+in InputE cbo_e.txt
+in InputF cbo_f.txt
+in InputG cbo_g.txt
diff --git a/yt/yql/tests/sql/suites/join/cbo_7tables_only_common_join.sql b/yt/yql/tests/sql/suites/join/cbo_7tables_only_common_join.sql
new file mode 100644
index 00000000000..8577fbe9dfa
--- /dev/null
+++ b/yt/yql/tests/sql/suites/join/cbo_7tables_only_common_join.sql
@@ -0,0 +1,31 @@
+/* ytfile can not */
+USE plato;
+
+pragma CostBasedOptimizer="native";
+pragma yt.MapJoinLimit="0";
+pragma yt.LookupJoinLimit="0";
+pragma yt.LookupJoinMaxRows="0";
+pragma yt.ExtendedStatsMaxChunkCount="0";
+pragma yt.JoinMergeTablesLimit="100";
+
+$s = (SELECT InputG.g3 AS g3, COUNT(*) AS cnt FROM
+ InputG
+ INNER JOIN InputE ON InputG.g2 = InputE.e1
+ INNER JOIN InputF ON InputF.f2 = InputG.g1
+ GROUP BY InputG.g3);
+
+SELECT
+ InputA.Key1,
+ InputA.Key2,
+ InputA.Value,
+ InputB.val,
+ InputC.v,
+ InputD.value as vald,
+ s.g3,
+ s.cnt
+FROM
+ InputA
+ INNER JOIN InputC ON InputA.Key1 = InputC.k
+ RIGHT JOIN InputD ON InputA.Key2 = InputD.k
+ RIGHT JOIN InputB ON InputA.Fk1 = InputB.k
+ INNER JOIN $s AS s ON InputD.value = s.g3;
diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_a.txt b/yt/yql/tests/sql/suites/join/cbo_a.txt
index 6c0c166030d..6c0c166030d 100644
--- a/yt/yql/tests/sql/suites/join/cbo_4tables_a.txt
+++ b/yt/yql/tests/sql/suites/join/cbo_a.txt
diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_a.txt.attr b/yt/yql/tests/sql/suites/join/cbo_a.txt.attr
index 295e5a3d06b..295e5a3d06b 100644
--- a/yt/yql/tests/sql/suites/join/cbo_4tables_a.txt.attr
+++ b/yt/yql/tests/sql/suites/join/cbo_a.txt.attr
diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_b.txt b/yt/yql/tests/sql/suites/join/cbo_b.txt
index 9ef08e2fb7d..9ef08e2fb7d 100644
--- a/yt/yql/tests/sql/suites/join/cbo_4tables_b.txt
+++ b/yt/yql/tests/sql/suites/join/cbo_b.txt
diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_b.txt.attr b/yt/yql/tests/sql/suites/join/cbo_b.txt.attr
index 460ca717f83..460ca717f83 100644
--- a/yt/yql/tests/sql/suites/join/cbo_4tables_b.txt.attr
+++ b/yt/yql/tests/sql/suites/join/cbo_b.txt.attr
diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_c.txt b/yt/yql/tests/sql/suites/join/cbo_c.txt
index 803ff2ca0db..803ff2ca0db 100644
--- a/yt/yql/tests/sql/suites/join/cbo_4tables_c.txt
+++ b/yt/yql/tests/sql/suites/join/cbo_c.txt
diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_c.txt.attr b/yt/yql/tests/sql/suites/join/cbo_c.txt.attr
index fb108546cd1..fb108546cd1 100644
--- a/yt/yql/tests/sql/suites/join/cbo_4tables_c.txt.attr
+++ b/yt/yql/tests/sql/suites/join/cbo_c.txt.attr
diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_d.txt b/yt/yql/tests/sql/suites/join/cbo_d.txt
index 13684e99050..13684e99050 100644
--- a/yt/yql/tests/sql/suites/join/cbo_4tables_d.txt
+++ b/yt/yql/tests/sql/suites/join/cbo_d.txt
diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_d.txt.attr b/yt/yql/tests/sql/suites/join/cbo_d.txt.attr
index 8050807ed9a..8050807ed9a 100644
--- a/yt/yql/tests/sql/suites/join/cbo_4tables_d.txt.attr
+++ b/yt/yql/tests/sql/suites/join/cbo_d.txt.attr
diff --git a/yt/yql/tests/sql/suites/join/cbo_e.txt b/yt/yql/tests/sql/suites/join/cbo_e.txt
new file mode 100644
index 00000000000..b944cc64233
--- /dev/null
+++ b/yt/yql/tests/sql/suites/join/cbo_e.txt
@@ -0,0 +1,4 @@
+{e1="pen"};
+{e1="pencil"};
+{e1="crayon"};
+{e1="sharpie"};
diff --git a/yt/yql/tests/sql/suites/join/cbo_e.txt.attr b/yt/yql/tests/sql/suites/join/cbo_e.txt.attr
new file mode 100644
index 00000000000..1f0c0de5179
--- /dev/null
+++ b/yt/yql/tests/sql/suites/join/cbo_e.txt.attr
@@ -0,0 +1,25 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["e1";["OptionalType";["DataType";"String"]]]]
+ ];
+ };
+
+
+
+ "schema" = <"strict" = %true; "unique_keys" = %false>
+ [
+ {
+ "name" = "e1";
+ "type" = "string";
+ "type_v3" = {"type_name" = "optional"; item = "string"}
+ };
+ ];
+ "extended_stats" = [
+ {
+ "column_name" = "e1";
+ "data_weight" = 26;
+ "num_unique_vals" = 4;
+ };
+ ]
+}
diff --git a/yt/yql/tests/sql/suites/join/cbo_f.txt b/yt/yql/tests/sql/suites/join/cbo_f.txt
new file mode 100644
index 00000000000..c4b16ea2623
--- /dev/null
+++ b/yt/yql/tests/sql/suites/join/cbo_f.txt
@@ -0,0 +1,6 @@
+{f2="0x0";val=17};
+{f2="0x0";val=18};
+{f2="0xaba";val=18};
+{f2="0xabc";val=-3};
+{f2="0x317";val=3};
+{f2="0x317";val=14};
diff --git a/yt/yql/tests/sql/suites/join/cbo_f.txt.attr b/yt/yql/tests/sql/suites/join/cbo_f.txt.attr
new file mode 100644
index 00000000000..7aa674fa15c
--- /dev/null
+++ b/yt/yql/tests/sql/suites/join/cbo_f.txt.attr
@@ -0,0 +1,34 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["f2";["OptionalType";["DataType";"String"]]];
+ ["val";["OptionalType";["DataType";"Int32"]]]]
+ ];
+ };
+
+ "schema" = <"strict" = %true; "unique_keys" = %false>
+ [
+ {
+ "name" = "f2";
+ "type" = "string";
+ "type_v3" = {"type_name" = "optional"; item = "string"}
+ };
+ {
+ "name" = "val";
+ "type" = "int64";
+ "type_v3" = {"type_name" = "optional"; item = "int64"}
+ };
+ ];
+ "extended_stats" = [
+ {
+ "column_name" = "f2";
+ "data_weight" = 32;
+ "num_unique_vals" = 4;
+ };
+ {
+ "column_name" = "val";
+ "data_weight" = 24;
+ "num_unique_vals" = 5;
+ };
+ ]
+}
diff --git a/yt/yql/tests/sql/suites/join/cbo_g.txt b/yt/yql/tests/sql/suites/join/cbo_g.txt
new file mode 100644
index 00000000000..61b2a64931a
--- /dev/null
+++ b/yt/yql/tests/sql/suites/join/cbo_g.txt
@@ -0,0 +1,6 @@
+{g1="0x317";g2="pen";g3=-44};
+{g1="0xaba";g2="pencil";g3=17};
+{g1="0xabc";g2="sharpie";g3=0};
+{g1="0xabc";g2="crayon";g3=1024};
+{g1="0xabf";g2="crayon";g3=25};
+{g1="0x0";g2="felt-tip";g3=0};
diff --git a/yt/yql/tests/sql/suites/join/cbo_g.txt.attr b/yt/yql/tests/sql/suites/join/cbo_g.txt.attr
new file mode 100644
index 00000000000..d03875bad8a
--- /dev/null
+++ b/yt/yql/tests/sql/suites/join/cbo_g.txt.attr
@@ -0,0 +1,45 @@
+{
+ "_yql_row_spec"={
+ "Type"=["StructType";[
+ ["g1";["OptionalType";["DataType";"String"]]];
+ ["g2";["OptionalType";["DataType";"String"]]];
+ ["g3";["OptionalType";["DataType";"Int32"]]]]
+ ];
+ };
+
+ "schema" = <"strict" = %true; "unique_keys" = %false>
+ [
+ {
+ "name" = "g1";
+ "type" = "string";
+ "type_v3" = {"type_name" = "optional"; item = "string"}
+ };
+ {
+ "name" = "g2";
+ "type" = "string";
+ "type_v3" = {"type_name" = "optional"; item = "string"}
+ };
+ {
+ "name" = "g3";
+ "type" = "int64";
+ "type_v3" = {"type_name" = "optional"; item = "int64"}
+ };
+ ];
+ "extended_stats" = [
+ {
+ "column_name" = "g1";
+ "data_weight" = 34;
+ "num_unique_vals" = 5;
+ };
+ {
+ "column_name" = "g2";
+ "data_weight" = 37;
+ "num_unique_vals" = 5;
+ };
+ {
+ "column_name" = "g3";
+ "data_weight" = 24;
+ "num_unique_vals" = 5;
+ };
+ ]
+}