@@ -92,7 +92,17 @@ static void CreateSampleTable(NYdb::NQuery::TSession session, bool useColumnStor
92
92
CreateView (session, " view/tpch_random_join_view.sql" );
93
93
}
94
94
95
- static TKikimrRunner GetKikimrWithJoinSettings (bool useStreamLookupJoin = false , TString stats = " " , bool useCBO = true ){
95
+ struct TExecuteParams {
96
+ bool RemoveLimitOperator = false ;
97
+ bool EnableSeparationComputeActorsFromRead = true ;
98
+ };
99
+
100
+ static TKikimrRunner GetKikimrWithJoinSettings (
101
+ bool useStreamLookupJoin = false ,
102
+ TString stats = " " ,
103
+ bool useCBO = true ,
104
+ const TExecuteParams& params = {}
105
+ ){
96
106
TVector<NKikimrKqp::TKqpSetting> settings;
97
107
98
108
NKikimrKqp::TKqpSetting setting;
@@ -116,6 +126,7 @@ static TKikimrRunner GetKikimrWithJoinSettings(bool useStreamLookupJoin = false,
116
126
appConfig.MutableTableServiceConfig ()->SetDefaultEnableShuffleElimination (true );
117
127
118
128
auto serverSettings = TKikimrSettings ().SetAppConfig (appConfig);
129
+ serverSettings.FeatureFlags .SetEnableSeparationComputeActorsFromRead (params.EnableSeparationComputeActorsFromRead );
119
130
serverSettings.SetKqpSettings (settings);
120
131
return TKikimrRunner (serverSettings);
121
132
}
@@ -365,8 +376,20 @@ Y_UNIT_TEST_SUITE(KqpJoinOrder) {
365
376
TChainTester (65 ).Test ();
366
377
}
367
378
379
+ <<<<<<< HEAD
368
380
TString ExecuteJoinOrderTestGenericQueryWithStats (const TString& queryPath, const TString& statsPath, bool useStreamLookupJoin, bool useColumnStore, bool useCBO = true ) {
369
381
auto kikimr = GetKikimrWithJoinSettings (useStreamLookupJoin, GetStatic (statsPath), useCBO);
382
+ =======
383
+ std::pair<TString, std::vector<NYdb::TResultSet>> ExecuteJoinOrderTestGenericQueryWithStats (
384
+ const TString& queryPath,
385
+ const TString& statsPath,
386
+ bool useStreamLookupJoin,
387
+ bool useColumnStore,
388
+ bool useCBO = true ,
389
+ const TExecuteParams& params = {}
390
+ ) {
391
+ auto kikimr = GetKikimrWithJoinSettings (useStreamLookupJoin, GetStatic (statsPath), useCBO, params);
392
+ >>>>>>> 62f01135b35 ([KQP] Add ShuffleEliminated flag (#20175 ))
370
393
kikimr.GetTestServer ().GetRuntime ()->GetAppData (0 ).FeatureFlags .SetEnableViews (true );
371
394
auto db = kikimr.GetQueryClient ();
372
395
auto session = db.GetSession ().GetValueSync ().GetSession ();
@@ -692,17 +715,27 @@ Y_UNIT_TEST_SUITE(KqpJoinOrder) {
692
715
TVector<TString> RequestedLabels;
693
716
};
694
717
718
+ <<<<<<< HEAD
695
719
Y_UNIT_TEST (ShuffleEliminationOneJoin) {
696
720
auto plan = ExecuteJoinOrderTestGenericQueryWithStats (" queries/shuffle_elimination_one_join.sql" , " stats/tpch1000s.json" , false , true , true );
721
+ =======
722
+ Y_UNIT_TEST_TWIN (ShuffleEliminationOneJoin, EnableSeparationComputeActorsFromRead) {
723
+ auto [plan, _] = ExecuteJoinOrderTestGenericQueryWithStats (" queries/shuffle_elimination_one_join.sql" , " stats/tpch1000s.json" , false , true , true , {.EnableSeparationComputeActorsFromRead = EnableSeparationComputeActorsFromRead});
724
+ >>>>>>> 62f01135b35 ([KQP] Add ShuffleEliminated flag (#20175 ))
697
725
auto joinFinder = TFindJoinWithLabels (plan);
698
726
auto join = joinFinder.Find ({" customer" , " orders" });
699
727
UNIT_ASSERT_C (join.Join == " InnerJoin (Grace)" , join.Join );
700
728
UNIT_ASSERT (!join.LhsShuffled );
701
729
UNIT_ASSERT (join.RhsShuffled );
702
730
}
703
731
732
+ <<<<<<< HEAD
704
733
Y_UNIT_TEST (ShuffleEliminationReuseShuffleTwoJoins) {
705
734
auto plan = ExecuteJoinOrderTestGenericQueryWithStats (" queries/shuffle_elimination_reuse_shuffle_two_joins.sql" , " stats/tpch1000s.json" , false , true , true );
735
+ =======
736
+ Y_UNIT_TEST_TWIN (ShuffleEliminationReuseShuffleTwoJoins, EnableSeparationComputeActorsFromRead) {
737
+ auto [plan, _] = ExecuteJoinOrderTestGenericQueryWithStats (" queries/shuffle_elimination_reuse_shuffle_two_joins.sql" , " stats/tpch1000s.json" , false , true , true , {.EnableSeparationComputeActorsFromRead = EnableSeparationComputeActorsFromRead});
738
+ >>>>>>> 62f01135b35 ([KQP] Add ShuffleEliminated flag (#20175 ))
706
739
auto joinFinder = TFindJoinWithLabels (plan);
707
740
708
741
{
0 commit comments