From fce2a692db534e71e5f317d2f7b40ea89753e187 Mon Sep 17 00:00:00 2001 From: robot-piglet Date: Fri, 14 Mar 2025 18:29:00 +0300 Subject: Intermediate changes commit_hash:e4d74265cffda90e1a7a702fed4b2e0dc1225a8c --- yt/yql/tests/sql/suites/join/cbo_4tables.cfg | 8 +-- yt/yql/tests/sql/suites/join/cbo_4tables_a.txt | 14 ----- .../tests/sql/suites/join/cbo_4tables_a.txt.attr | 61 ---------------------- yt/yql/tests/sql/suites/join/cbo_4tables_b.txt | 3 -- .../tests/sql/suites/join/cbo_4tables_b.txt.attr | 34 ------------ yt/yql/tests/sql/suites/join/cbo_4tables_c.txt | 5 -- .../tests/sql/suites/join/cbo_4tables_c.txt.attr | 34 ------------ yt/yql/tests/sql/suites/join/cbo_4tables_d.txt | 11 ---- .../tests/sql/suites/join/cbo_4tables_d.txt.attr | 50 ------------------ .../suites/join/cbo_4tables_only_sorted_merge.cfg | 8 +-- yt/yql/tests/sql/suites/join/cbo_7tables.cfg | 8 +++ yt/yql/tests/sql/suites/join/cbo_7tables.sql | 31 +++++++++++ .../suites/join/cbo_7tables_only_common_join.cfg | 8 +++ .../suites/join/cbo_7tables_only_common_join.sql | 31 +++++++++++ yt/yql/tests/sql/suites/join/cbo_a.txt | 14 +++++ yt/yql/tests/sql/suites/join/cbo_a.txt.attr | 61 ++++++++++++++++++++++ yt/yql/tests/sql/suites/join/cbo_b.txt | 3 ++ yt/yql/tests/sql/suites/join/cbo_b.txt.attr | 34 ++++++++++++ yt/yql/tests/sql/suites/join/cbo_c.txt | 5 ++ yt/yql/tests/sql/suites/join/cbo_c.txt.attr | 34 ++++++++++++ yt/yql/tests/sql/suites/join/cbo_d.txt | 11 ++++ yt/yql/tests/sql/suites/join/cbo_d.txt.attr | 50 ++++++++++++++++++ yt/yql/tests/sql/suites/join/cbo_e.txt | 4 ++ yt/yql/tests/sql/suites/join/cbo_e.txt.attr | 25 +++++++++ yt/yql/tests/sql/suites/join/cbo_f.txt | 6 +++ yt/yql/tests/sql/suites/join/cbo_f.txt.attr | 34 ++++++++++++ yt/yql/tests/sql/suites/join/cbo_g.txt | 6 +++ yt/yql/tests/sql/suites/join/cbo_g.txt.attr | 45 ++++++++++++++++ 28 files changed, 418 insertions(+), 220 deletions(-) delete mode 100644 yt/yql/tests/sql/suites/join/cbo_4tables_a.txt delete mode 100644 yt/yql/tests/sql/suites/join/cbo_4tables_a.txt.attr delete mode 100644 yt/yql/tests/sql/suites/join/cbo_4tables_b.txt delete mode 100644 yt/yql/tests/sql/suites/join/cbo_4tables_b.txt.attr delete mode 100644 yt/yql/tests/sql/suites/join/cbo_4tables_c.txt delete mode 100644 yt/yql/tests/sql/suites/join/cbo_4tables_c.txt.attr delete mode 100644 yt/yql/tests/sql/suites/join/cbo_4tables_d.txt delete mode 100644 yt/yql/tests/sql/suites/join/cbo_4tables_d.txt.attr create mode 100644 yt/yql/tests/sql/suites/join/cbo_7tables.cfg create mode 100644 yt/yql/tests/sql/suites/join/cbo_7tables.sql create mode 100644 yt/yql/tests/sql/suites/join/cbo_7tables_only_common_join.cfg create mode 100644 yt/yql/tests/sql/suites/join/cbo_7tables_only_common_join.sql create mode 100644 yt/yql/tests/sql/suites/join/cbo_a.txt create mode 100644 yt/yql/tests/sql/suites/join/cbo_a.txt.attr create mode 100644 yt/yql/tests/sql/suites/join/cbo_b.txt create mode 100644 yt/yql/tests/sql/suites/join/cbo_b.txt.attr create mode 100644 yt/yql/tests/sql/suites/join/cbo_c.txt create mode 100644 yt/yql/tests/sql/suites/join/cbo_c.txt.attr create mode 100644 yt/yql/tests/sql/suites/join/cbo_d.txt create mode 100644 yt/yql/tests/sql/suites/join/cbo_d.txt.attr create mode 100644 yt/yql/tests/sql/suites/join/cbo_e.txt create mode 100644 yt/yql/tests/sql/suites/join/cbo_e.txt.attr create mode 100644 yt/yql/tests/sql/suites/join/cbo_f.txt create mode 100644 yt/yql/tests/sql/suites/join/cbo_f.txt.attr create mode 100644 yt/yql/tests/sql/suites/join/cbo_g.txt create mode 100644 yt/yql/tests/sql/suites/join/cbo_g.txt.attr 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_a.txt b/yt/yql/tests/sql/suites/join/cbo_4tables_a.txt deleted file mode 100644 index 6c0c166030d..00000000000 --- a/yt/yql/tests/sql/suites/join/cbo_4tables_a.txt +++ /dev/null @@ -1,14 +0,0 @@ -{"Key1"=101;"Key2"="One";"Fk1"=#;"Value"="no_right_key_1"}; -{"Key1"=102;"Key2"="Two";"Fk1"=#;"Value"="no_right_key_2"}; -{"Key1"=103;"Key2"="Three";"Fk1"="Name1";"Value"="Value1"}; -{"Key1"=104;"Key2"="One";"Fk1"="Name2";"Value"="Value2"}; -{"Key1"=104;"Key2"="Two";"Fk1"="Name2";"Value"="Value3"}; -{"Key1"=105;"Key2"="One";"Fk1"="Name3";"Value"="no_right_key_3"}; -{"Key1"=106;"Key2"="One";"Fk1"="Name4";"Value"=#}; -{"Key1"=106;"Key2"="Two";"Fk1"="Name4";"Value"="Value4"}; -{"Key1"=107;"Key2"="Seventeen";"Fk1"="Name4";"Value"="Value4"}; -{"Key1"=108;"Key2"="Two";"Fk1"="Name4";"Value"="Value4"}; -{"Key1"=109;"Key2"="Two";"Fk1"="Name1";"Value"="Value4"}; -{"Key1"=110;"Key2"="Four";"Fk1"="Name5";"Value"="Value4"}; -{"Key1"=111;"Key2"="Three";"Fk1"="Name4";"Value"="Value4"}; -{"Key1"=111;"Key2"="Two";"Fk1"="Name4";"Value"="Value4"}; diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_a.txt.attr b/yt/yql/tests/sql/suites/join/cbo_4tables_a.txt.attr deleted file mode 100644 index 295e5a3d06b..00000000000 --- a/yt/yql/tests/sql/suites/join/cbo_4tables_a.txt.attr +++ /dev/null @@ -1,61 +0,0 @@ -{ - "_yql_row_spec"={ - "Type"=["StructType";[ - ["Key1";["DataType";"Int32"]]; - ["Key2";["DataType";"String"]]; - ["Fk1";["OptionalType";["DataType";"String"]]]; - ["Value";["OptionalType";["DataType";"String"]]]] - ]; - "SortDirections"=[1;1]; - "SortedBy"=["Key1";"Key2"]; - "SortedByTypes"=[["DataType";"Int32";];["DataType";"String"]]; - "SortMembers"=["Key1";"Key2"]; - }; - "schema" = <"strict" = %true; "unique_keys" = %false> - [ - { - "name" = "Key1"; - "sort_order" = "ascending"; - "type" = "int64"; - "type_v3" = {"type_name" = "optional"; item = "int64"} - }; - { - "name" = "Key2"; - "sort_order" = "ascending"; - "type" = "string"; - "type_v3" = {"type_name" = "optional"; item = "string"} - }; - { - "name" = "Fk1"; - "type" = "string"; - "type_v3" = {"type_name" = "optional"; item = "string"} - }; - { - "name" = "Value"; - "type" = "string"; - "type_v3" = {"type_name" = "optional"; item = "string"} - }; - ]; - "extended_stats" = [ - { - "column_name" = "Key1"; - "data_weight" = 56; - "num_unique_vals" = 11; - }; - { - "column_name" = "Key2"; - "data_weight" = 66; - "num_unique_vals" = 5; - }; - { - "column_name" = "Fk1"; - "data_weight" = 70; - "num_unique_vals" = 5; - }; - { - "column_name" = "Value"; - "data_weight" = 98; - "num_unique_vals" = 6; - } - ] -} diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_b.txt b/yt/yql/tests/sql/suites/join/cbo_4tables_b.txt deleted file mode 100644 index 9ef08e2fb7d..00000000000 --- a/yt/yql/tests/sql/suites/join/cbo_4tables_b.txt +++ /dev/null @@ -1,3 +0,0 @@ -{"k"="Name2";"val"="Misha"}; -{"k"="Name2";"val"="Sasha"}; -{"k"="Name3";"val"="Ksyusha"}; diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_b.txt.attr b/yt/yql/tests/sql/suites/join/cbo_4tables_b.txt.attr deleted file mode 100644 index 460ca717f83..00000000000 --- a/yt/yql/tests/sql/suites/join/cbo_4tables_b.txt.attr +++ /dev/null @@ -1,34 +0,0 @@ -{ - "_yql_row_spec"={ - "Type"=["StructType";[ - ["k";["OptionalType";["DataType";"String"]]]; - ["val";["OptionalType";["DataType";"String"]]]] - ]; - }; - - "schema" = <"strict" = %true; "unique_keys" = %false> - [ - { - "name" = "k"; - "type" = "string"; - "type_v3" = {"type_name" = "optional"; item = "string"} - }; - { - "name" = "val"; - "type" = "string"; - "type_v3" = {"type_name" = "optional"; item = "string"} - }; - ]; - "extended_stats" = [ - { - "column_name" = "k"; - "data_weight" = 18; - "num_unique_vals" = 2; - }; - { - "column_name" = "val"; - "data_weight" = 20; - "num_unique_vals" = 3; - } - ] -} diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_c.txt b/yt/yql/tests/sql/suites/join/cbo_4tables_c.txt deleted file mode 100644 index 803ff2ca0db..00000000000 --- a/yt/yql/tests/sql/suites/join/cbo_4tables_c.txt +++ /dev/null @@ -1,5 +0,0 @@ -{"k"=104;v=4}; -{"k"=105;v=5}; -{"k"=106;v=6}; -{"k"=107;v=6}; -{"k"=111;v=10}; diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_c.txt.attr b/yt/yql/tests/sql/suites/join/cbo_4tables_c.txt.attr deleted file mode 100644 index fb108546cd1..00000000000 --- a/yt/yql/tests/sql/suites/join/cbo_4tables_c.txt.attr +++ /dev/null @@ -1,34 +0,0 @@ -{ - "_yql_row_spec"={ - "Type"=["StructType";[ - ["k";["OptionalType";["DataType";"Int64"]]]; - ["v";["OptionalType";["DataType";"Int64"]]]] - ]; - }; - - "schema" = <"strict" = %true; "unique_keys" = %false> - [ - { - "name" = "k"; - "type" = "int64"; - "type_v3" = {"type_name" = "optional"; item = "int64"} - }; - { - "name" = "v"; - "type" = "int64"; - "type_v3" = {"type_name" = "optional"; item = "int64"} - }; - ]; - "extended_stats" = [ - { - "column_name" = "k"; - "data_weight" = 12; - "num_unique_vals" = 3; - }; - { - "column_name" = "v"; - "data_weight" = 12; - "num_unique_vals" = 3; - } - ]; -} diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_d.txt b/yt/yql/tests/sql/suites/join/cbo_4tables_d.txt deleted file mode 100644 index 13684e99050..00000000000 --- a/yt/yql/tests/sql/suites/join/cbo_4tables_d.txt +++ /dev/null @@ -1,11 +0,0 @@ -{id=3;"k"="One";"value"=17}; -{id=5;"k"="Two";"value"=17}; -{id=13;"k"="One";"value"=0}; -{id=23;"k"="Three";"value"=-44}; -{id=27;"k"="Ten";"value"=17}; -{id=33;"k"="Zero";"value"=1024}; -{id=38;"k"="Seventeen";"value"=17}; -{id=39;"k"="One";"value"=23}; -{id=40;"k"="Three";"value"=17}; -{id=42;"k"="Four";"value"=25}; -{id=50;"k"="One";"value"=17}; diff --git a/yt/yql/tests/sql/suites/join/cbo_4tables_d.txt.attr b/yt/yql/tests/sql/suites/join/cbo_4tables_d.txt.attr deleted file mode 100644 index 8050807ed9a..00000000000 --- a/yt/yql/tests/sql/suites/join/cbo_4tables_d.txt.attr +++ /dev/null @@ -1,50 +0,0 @@ -{ - "_yql_row_spec"={ - "Type"=["StructType";[ - ["id";["DataType";"Int32"]]; - ["k";["OptionalType";["DataType";"String"]]]; - ["value";["OptionalType";["DataType";"Int64"]]]] - ]; - "SortDirections"=[1]; - "SortedBy"=["id"]; - "SortedByTypes"=[["DataType";"Int32"]]; - "SortMembers"=["id"]; - }; - - "schema" = <"strict" = %true; "unique_keys" = %false> - [ - { - "name" = "id"; - "sort_order" = "ascending"; - "type" = "int64"; - "type_v3" = {"type_name" = "optional"; item = "int64"} - }; - { - "name" = "k"; - "type" = "string"; - "type_v3" = {"type_name" = "optional"; item = "string"} - }; - { - "name" = "value"; - "type" = "int64"; - "type_v3" = {"type_name" = "optional"; item = "int64"} - }; - ]; - "extended_stats" = [ - { - "column_name" = "id"; - "data_weight" = 44; - "num_unique_vals" = 11; - }; - { - "column_name" = "k"; - "data_weight" = 66; - "num_unique_vals" = 7; - }; - { - "column_name" = "value"; - "data_weight" = 44; - "num_unique_vals" = 6; - } - ]; -} 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_a.txt b/yt/yql/tests/sql/suites/join/cbo_a.txt new file mode 100644 index 00000000000..6c0c166030d --- /dev/null +++ b/yt/yql/tests/sql/suites/join/cbo_a.txt @@ -0,0 +1,14 @@ +{"Key1"=101;"Key2"="One";"Fk1"=#;"Value"="no_right_key_1"}; +{"Key1"=102;"Key2"="Two";"Fk1"=#;"Value"="no_right_key_2"}; +{"Key1"=103;"Key2"="Three";"Fk1"="Name1";"Value"="Value1"}; +{"Key1"=104;"Key2"="One";"Fk1"="Name2";"Value"="Value2"}; +{"Key1"=104;"Key2"="Two";"Fk1"="Name2";"Value"="Value3"}; +{"Key1"=105;"Key2"="One";"Fk1"="Name3";"Value"="no_right_key_3"}; +{"Key1"=106;"Key2"="One";"Fk1"="Name4";"Value"=#}; +{"Key1"=106;"Key2"="Two";"Fk1"="Name4";"Value"="Value4"}; +{"Key1"=107;"Key2"="Seventeen";"Fk1"="Name4";"Value"="Value4"}; +{"Key1"=108;"Key2"="Two";"Fk1"="Name4";"Value"="Value4"}; +{"Key1"=109;"Key2"="Two";"Fk1"="Name1";"Value"="Value4"}; +{"Key1"=110;"Key2"="Four";"Fk1"="Name5";"Value"="Value4"}; +{"Key1"=111;"Key2"="Three";"Fk1"="Name4";"Value"="Value4"}; +{"Key1"=111;"Key2"="Two";"Fk1"="Name4";"Value"="Value4"}; diff --git a/yt/yql/tests/sql/suites/join/cbo_a.txt.attr b/yt/yql/tests/sql/suites/join/cbo_a.txt.attr new file mode 100644 index 00000000000..295e5a3d06b --- /dev/null +++ b/yt/yql/tests/sql/suites/join/cbo_a.txt.attr @@ -0,0 +1,61 @@ +{ + "_yql_row_spec"={ + "Type"=["StructType";[ + ["Key1";["DataType";"Int32"]]; + ["Key2";["DataType";"String"]]; + ["Fk1";["OptionalType";["DataType";"String"]]]; + ["Value";["OptionalType";["DataType";"String"]]]] + ]; + "SortDirections"=[1;1]; + "SortedBy"=["Key1";"Key2"]; + "SortedByTypes"=[["DataType";"Int32";];["DataType";"String"]]; + "SortMembers"=["Key1";"Key2"]; + }; + "schema" = <"strict" = %true; "unique_keys" = %false> + [ + { + "name" = "Key1"; + "sort_order" = "ascending"; + "type" = "int64"; + "type_v3" = {"type_name" = "optional"; item = "int64"} + }; + { + "name" = "Key2"; + "sort_order" = "ascending"; + "type" = "string"; + "type_v3" = {"type_name" = "optional"; item = "string"} + }; + { + "name" = "Fk1"; + "type" = "string"; + "type_v3" = {"type_name" = "optional"; item = "string"} + }; + { + "name" = "Value"; + "type" = "string"; + "type_v3" = {"type_name" = "optional"; item = "string"} + }; + ]; + "extended_stats" = [ + { + "column_name" = "Key1"; + "data_weight" = 56; + "num_unique_vals" = 11; + }; + { + "column_name" = "Key2"; + "data_weight" = 66; + "num_unique_vals" = 5; + }; + { + "column_name" = "Fk1"; + "data_weight" = 70; + "num_unique_vals" = 5; + }; + { + "column_name" = "Value"; + "data_weight" = 98; + "num_unique_vals" = 6; + } + ] +} diff --git a/yt/yql/tests/sql/suites/join/cbo_b.txt b/yt/yql/tests/sql/suites/join/cbo_b.txt new file mode 100644 index 00000000000..9ef08e2fb7d --- /dev/null +++ b/yt/yql/tests/sql/suites/join/cbo_b.txt @@ -0,0 +1,3 @@ +{"k"="Name2";"val"="Misha"}; +{"k"="Name2";"val"="Sasha"}; +{"k"="Name3";"val"="Ksyusha"}; diff --git a/yt/yql/tests/sql/suites/join/cbo_b.txt.attr b/yt/yql/tests/sql/suites/join/cbo_b.txt.attr new file mode 100644 index 00000000000..460ca717f83 --- /dev/null +++ b/yt/yql/tests/sql/suites/join/cbo_b.txt.attr @@ -0,0 +1,34 @@ +{ + "_yql_row_spec"={ + "Type"=["StructType";[ + ["k";["OptionalType";["DataType";"String"]]]; + ["val";["OptionalType";["DataType";"String"]]]] + ]; + }; + + "schema" = <"strict" = %true; "unique_keys" = %false> + [ + { + "name" = "k"; + "type" = "string"; + "type_v3" = {"type_name" = "optional"; item = "string"} + }; + { + "name" = "val"; + "type" = "string"; + "type_v3" = {"type_name" = "optional"; item = "string"} + }; + ]; + "extended_stats" = [ + { + "column_name" = "k"; + "data_weight" = 18; + "num_unique_vals" = 2; + }; + { + "column_name" = "val"; + "data_weight" = 20; + "num_unique_vals" = 3; + } + ] +} diff --git a/yt/yql/tests/sql/suites/join/cbo_c.txt b/yt/yql/tests/sql/suites/join/cbo_c.txt new file mode 100644 index 00000000000..803ff2ca0db --- /dev/null +++ b/yt/yql/tests/sql/suites/join/cbo_c.txt @@ -0,0 +1,5 @@ +{"k"=104;v=4}; +{"k"=105;v=5}; +{"k"=106;v=6}; +{"k"=107;v=6}; +{"k"=111;v=10}; diff --git a/yt/yql/tests/sql/suites/join/cbo_c.txt.attr b/yt/yql/tests/sql/suites/join/cbo_c.txt.attr new file mode 100644 index 00000000000..fb108546cd1 --- /dev/null +++ b/yt/yql/tests/sql/suites/join/cbo_c.txt.attr @@ -0,0 +1,34 @@ +{ + "_yql_row_spec"={ + "Type"=["StructType";[ + ["k";["OptionalType";["DataType";"Int64"]]]; + ["v";["OptionalType";["DataType";"Int64"]]]] + ]; + }; + + "schema" = <"strict" = %true; "unique_keys" = %false> + [ + { + "name" = "k"; + "type" = "int64"; + "type_v3" = {"type_name" = "optional"; item = "int64"} + }; + { + "name" = "v"; + "type" = "int64"; + "type_v3" = {"type_name" = "optional"; item = "int64"} + }; + ]; + "extended_stats" = [ + { + "column_name" = "k"; + "data_weight" = 12; + "num_unique_vals" = 3; + }; + { + "column_name" = "v"; + "data_weight" = 12; + "num_unique_vals" = 3; + } + ]; +} diff --git a/yt/yql/tests/sql/suites/join/cbo_d.txt b/yt/yql/tests/sql/suites/join/cbo_d.txt new file mode 100644 index 00000000000..13684e99050 --- /dev/null +++ b/yt/yql/tests/sql/suites/join/cbo_d.txt @@ -0,0 +1,11 @@ +{id=3;"k"="One";"value"=17}; +{id=5;"k"="Two";"value"=17}; +{id=13;"k"="One";"value"=0}; +{id=23;"k"="Three";"value"=-44}; +{id=27;"k"="Ten";"value"=17}; +{id=33;"k"="Zero";"value"=1024}; +{id=38;"k"="Seventeen";"value"=17}; +{id=39;"k"="One";"value"=23}; +{id=40;"k"="Three";"value"=17}; +{id=42;"k"="Four";"value"=25}; +{id=50;"k"="One";"value"=17}; diff --git a/yt/yql/tests/sql/suites/join/cbo_d.txt.attr b/yt/yql/tests/sql/suites/join/cbo_d.txt.attr new file mode 100644 index 00000000000..8050807ed9a --- /dev/null +++ b/yt/yql/tests/sql/suites/join/cbo_d.txt.attr @@ -0,0 +1,50 @@ +{ + "_yql_row_spec"={ + "Type"=["StructType";[ + ["id";["DataType";"Int32"]]; + ["k";["OptionalType";["DataType";"String"]]]; + ["value";["OptionalType";["DataType";"Int64"]]]] + ]; + "SortDirections"=[1]; + "SortedBy"=["id"]; + "SortedByTypes"=[["DataType";"Int32"]]; + "SortMembers"=["id"]; + }; + + "schema" = <"strict" = %true; "unique_keys" = %false> + [ + { + "name" = "id"; + "sort_order" = "ascending"; + "type" = "int64"; + "type_v3" = {"type_name" = "optional"; item = "int64"} + }; + { + "name" = "k"; + "type" = "string"; + "type_v3" = {"type_name" = "optional"; item = "string"} + }; + { + "name" = "value"; + "type" = "int64"; + "type_v3" = {"type_name" = "optional"; item = "int64"} + }; + ]; + "extended_stats" = [ + { + "column_name" = "id"; + "data_weight" = 44; + "num_unique_vals" = 11; + }; + { + "column_name" = "k"; + "data_weight" = 66; + "num_unique_vals" = 7; + }; + { + "column_name" = "value"; + "data_weight" = 44; + "num_unique_vals" = 6; + } + ]; +} 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; + }; + ] +} -- cgit v1.3