@@ -42,7 +42,7 @@ struct TTestContext : public TBaseProviderContext {
4242 const TVector<NDq::TJoinColumn>& ,
4343 const TVector<NDq::TJoinColumn>& ,
4444 EJoinAlgoType ,
45- EJoinKind
45+ EJoinKind
4646 ) override {
4747 return true ;
4848 }
@@ -53,8 +53,8 @@ std::shared_ptr<IBaseOptimizerNode> Enumerate(const std::shared_ptr<IBaseOptimiz
5353 auto ctx = TProviderContext ();
5454 TExprContext dummyCtx;
5555 auto optimizer =
56- std::unique_ptr<IOptimizerNew>(MakeNativeOptimizerNew (ctx, std::numeric_limits<ui32>::max (), dummyCtx));
57-
56+ std::unique_ptr<IOptimizerNew>(MakeNativeOptimizerNew (ctx, std::numeric_limits<ui32>::max (), dummyCtx, false ));
57+
5858 Y_ENSURE (root->Kind == EOptimizerNodeKind::JoinNodeType);
5959 auto res = optimizer->JoinSearch (std::static_pointer_cast<TJoinOptimizerNode>(root), hints);
6060 Cout << " Optimized Tree:" << Endl;
@@ -76,25 +76,25 @@ TVector<TJoinColumn> CollectConditions(const std::shared_ptr<IBaseOptimizerNode>
7676 lhsConds.push_back (lhsCond);
7777 lhsConds.push_back (rhsCond);
7878 }
79-
79+
8080 return lhsConds;
8181}
8282
8383bool HaveSameConditions (const std::shared_ptr<IBaseOptimizerNode>& actual, std::shared_ptr<IBaseOptimizerNode> expected) {
8484 auto actualConds = CollectConditions (actual);
8585 auto expectedConds = CollectConditions (expected);
8686
87- return
88- std::unordered_set<TJoinColumn, TJoinColumn::THashFunction>(actualConds.begin (), actualConds.end ()) ==
87+ return
88+ std::unordered_set<TJoinColumn, TJoinColumn::THashFunction>(actualConds.begin (), actualConds.end ()) ==
8989 std::unordered_set<TJoinColumn, TJoinColumn::THashFunction>(expectedConds.begin (), expectedConds.end ());
9090}
9191
9292bool HaveSameConditionCount (const std::shared_ptr<IBaseOptimizerNode>& actual, std::shared_ptr<IBaseOptimizerNode> expected) {
9393 auto actualConds = CollectConditions (actual);
9494 auto expectedConds = CollectConditions (expected);
95-
95+
9696 return actualConds.size () == expectedConds.size () &&
97- std::unordered_set<TJoinColumn, TJoinColumn::THashFunction>(actualConds.begin (), actualConds.end ()).size () ==
97+ std::unordered_set<TJoinColumn, TJoinColumn::THashFunction>(actualConds.begin (), actualConds.end ()).size () ==
9898 std::unordered_set<TJoinColumn, TJoinColumn::THashFunction>(expectedConds.begin (), expectedConds.end ()).size ();
9999}
100100
@@ -107,7 +107,7 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
107107
108108 for (size_t i = 0 ; i < nodeCount; ++i) {
109109 for (size_t j = 0 ; j < nodeCount; ++j) {
110- if (i == j) continue ;
110+ if (i == j) continue ;
111111
112112 TNodeSet64 lhs; lhs[i] = 1 ;
113113 TNodeSet64 rhs; rhs[j] = 1 ;
@@ -122,17 +122,17 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
122122
123123 UNIT_ASSERT (graph.GetEdges ().size () == 6 );
124124
125- CheckClique (graph);
125+ CheckClique (graph);
126126 Enumerate (root);
127127 }
128128
129129 Y_UNIT_TEST (SimpleChain4NodesTransitiveClosure) {
130130 auto root = CreateChain (4 , " Ya hochu pitsu" );
131131 auto graph = MakeJoinHypergraph<TNodeSet64>(root);
132-
132+
133133 UNIT_ASSERT (graph.GetEdges ().size () == 12 );
134134
135- CheckClique (graph);
135+ CheckClique (graph);
136136 Enumerate (root);
137137 }
138138
@@ -142,7 +142,7 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
142142
143143 UNIT_ASSERT (graph.GetEdges ().size () == 20 );
144144
145- CheckClique (graph);
145+ CheckClique (graph);
146146 Enumerate (root);
147147 }
148148
@@ -166,7 +166,7 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
166166
167167 rhs = CreateChain (2 , " 228" , " c" );
168168
169- // a1 --228-- a2 --228-- a3 --1337-- b1 --1337-- b2 --123-- c1 --228-- c2
169+ // a1 --228-- a2 --228-- a3 --1337-- b1 --1337-- b2 --123-- c1 --228-- c2
170170 // ^ we don't want to have transitive closure between c and a
171171 root = std::make_shared<TJoinOptimizerNode>(
172172 root, rhs, leftKeys, rightKeys, EJoinKind::InnerJoin, EJoinAlgoType::Undefined, false , false
@@ -211,7 +211,7 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
211211 return root;
212212 } else {
213213 static_assert (
214- std::is_convertible_v<TJoinArg, std::string> || std::is_same_v<TJoinArg, std::shared_ptr<IBaseOptimizerNode>>,
214+ std::is_convertible_v<TJoinArg, std::string> || std::is_same_v<TJoinArg, std::shared_ptr<IBaseOptimizerNode>>,
215215 " Args of join must be either Join or TString, for example: Join(Join('A', 'B'), 'C')"
216216 );
217217 }
@@ -252,7 +252,7 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
252252 TString attr = ToString (rand ());
253253 leftJoinCond.push_back (TJoinColumn (std::move (lhsCond), attr));
254254 rightJoinCond.push_back (TJoinColumn (std::move (rhsCond), attr));
255-
255+
256256 }
257257 }
258258
@@ -288,7 +288,7 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
288288
289289 Y_UNIT_TEST (SimpleDimpleJoin) {
290290 auto join = Join (" A" , " B" );
291-
291+
292292 auto graph = MakeJoinHypergraph<TNodeSet64>(join);
293293 Cout << graph.String () << Endl;
294294
@@ -301,7 +301,7 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
301301
302302 auto graph = MakeJoinHypergraph<TNodeSet64>(root);
303303 Cout << graph.String () << Endl;
304-
304+
305305 auto A = graph.GetNodesByRelNames ({" A" });
306306 auto B = graph.GetNodesByRelNames ({" B" });
307307 auto C = graph.GetNodesByRelNames ({" C" });
@@ -318,7 +318,7 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
318318 auto anyJoin = Join (Join (" A" , " B" ), " C" , /* on=*/ " B=C" );
319319 std::static_pointer_cast<TJoinOptimizerNode>(anyJoin)->LeftAny = true ;
320320 auto join = Join (anyJoin, " D" , /* on=*/ " A=D" );
321-
321+
322322 auto graph = MakeJoinHypergraph<TNodeSet64>(join);
323323 Cout << graph.String () << Endl;
324324 UNIT_ASSERT (graph.GetEdges ().size () != graph.GetSimpleEdges ().size ());
@@ -331,7 +331,7 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
331331 auto anyJoin = Join (Join (Join (" A" , " B" ), " C" , /* on=*/ " B=C" ), " D" , " C=D" );
332332 std::static_pointer_cast<TJoinOptimizerNode>(anyJoin)->LeftAny = true ;
333333 auto join = Join (anyJoin, " E" , /* on=*/ " A=E" );
334-
334+
335335 auto graph = MakeJoinHypergraph<TNodeSet64>(join);
336336 Cout << graph.String () << Endl;
337337 UNIT_ASSERT (graph.GetEdges ().size () != graph.GetSimpleEdges ().size ());
@@ -343,7 +343,7 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
343343 auto anyJoin = Join (Join (" A" , " B" ), Join (" C" , " D" ), /* on=*/ " B=C" );
344344 std::static_pointer_cast<TJoinOptimizerNode>(anyJoin)->RightAny = true ;
345345 auto join = Join (anyJoin, " E" , /* on=*/ " C=E" );
346-
346+
347347 auto graph = MakeJoinHypergraph<TNodeSet64>(join);
348348 Cout << graph.String () << Endl;
349349 UNIT_ASSERT (graph.GetEdges ().size () != graph.GetSimpleEdges ().size ());
@@ -355,7 +355,7 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
355355 auto nonReorderable = Join (Join (Join (" A" , " B" ), " C" , /* on=*/ " B=C" ), " D" , " C=D" );
356356 std::static_pointer_cast<TJoinOptimizerNode>(nonReorderable)->IsReorderable = false ;
357357 auto join = Join (nonReorderable, " E" , /* on=*/ " A=E" );
358-
358+
359359 auto graph = MakeJoinHypergraph<TNodeSet64>(join);
360360 Cout << graph.String () << Endl;
361361 UNIT_ASSERT (graph.GetEdges ().size () != graph.GetSimpleEdges ().size ());
@@ -556,7 +556,7 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
556556 return res;
557557 };
558558
559- auto mean = [](const TVector<double >& v) -> double {
559+ auto mean = [](const TVector<double >& v) -> double {
560560 double sum = std::accumulate (v.begin (), v.end (), 0.0 );
561561 return sum / static_cast <double >(v.size ());
562562 };
0 commit comments