@@ -249,68 +249,6 @@ void TestTableSplitBoundariesArePreserved(
249
249
UNIT_ASSERT_EQUAL (restoredTableDescription.GetKeyRanges (), originalKeyRanges);
250
250
}
251
251
252
- void TestIndexTableSplitBoundariesArePreserved (
253
- const char * table, const char * index, ui64 indexPartitions, TSession& session,
254
- TBackupFunction&& backup, TRestoreFunction&& restore
255
- ) {
256
- const TString indexTablePath = JoinFsPaths (table, index , " indexImplTable" );
257
-
258
- {
259
- TExplicitPartitions indexPartitionBoundaries;
260
- for (ui32 boundary : {1 , 2 , 4 , 8 , 16 , 32 , 64 , 128 , 256 }) {
261
- indexPartitionBoundaries.AppendSplitPoints (
262
- // split boundary is technically always a tuple
263
- TValueBuilder ().BeginTuple ().AddElement ().OptionalUint32 (boundary).EndTuple ().Build ()
264
- );
265
- }
266
- // By default indexImplTable has auto partitioning by size enabled,
267
- // so you must set min partition count for partitions to not merge immediately after indexImplTable is built.
268
- TPartitioningSettingsBuilder partitioningSettingsBuilder;
269
- partitioningSettingsBuilder
270
- .SetMinPartitionsCount (indexPartitions)
271
- .SetMaxPartitionsCount (indexPartitions);
272
-
273
- const auto indexSettings = TGlobalIndexSettings{
274
- .PartitioningSettings = partitioningSettingsBuilder.Build (),
275
- .Partitions = std::move (indexPartitionBoundaries)
276
- };
277
-
278
- auto tableBuilder = TTableBuilder ()
279
- .AddNullableColumn (" Key" , EPrimitiveType::Uint32)
280
- .AddNullableColumn (" Value" , EPrimitiveType::Uint32)
281
- .SetPrimaryKeyColumn (" Key" )
282
- .AddSecondaryIndex (TIndexDescription (" byValue" , EIndexType::GlobalSync, { " Value" }, {}, { indexSettings }));
283
-
284
- const auto result = session.CreateTable (table, tableBuilder.Build ()).ExtractValueSync ();
285
- UNIT_ASSERT_C (result.IsSuccess (), result.GetIssues ().ToString ());
286
- }
287
- const auto describeSettings = TDescribeTableSettings ()
288
- .WithTableStatistics (true )
289
- .WithKeyShardBoundary (true );
290
- const auto originalIndexTableDescription = GetTableDescription (
291
- session, indexTablePath, describeSettings
292
- );
293
- UNIT_ASSERT_VALUES_EQUAL (originalIndexTableDescription.GetPartitionsCount (), indexPartitions);
294
- const auto & originalKeyRanges = originalIndexTableDescription.GetKeyRanges ();
295
- UNIT_ASSERT_VALUES_EQUAL (originalKeyRanges.size (), indexPartitions);
296
-
297
- backup (table);
298
-
299
- ExecuteDataDefinitionQuery (session, Sprintf (R"(
300
- DROP TABLE `%s`;
301
- )" , table
302
- ));
303
-
304
- restore (table);
305
- const auto restoredIndexTableDescription = GetTableDescription (
306
- session, indexTablePath, describeSettings
307
- );
308
- UNIT_ASSERT_VALUES_EQUAL (restoredIndexTableDescription.GetPartitionsCount (), indexPartitions);
309
- const auto & restoredKeyRanges = restoredIndexTableDescription.GetKeyRanges ();
310
- UNIT_ASSERT_VALUES_EQUAL (restoredKeyRanges.size (), indexPartitions);
311
- UNIT_ASSERT_EQUAL (restoredKeyRanges, originalKeyRanges);
312
- }
313
-
314
252
}
315
253
316
254
Y_UNIT_TEST_SUITE (BackupRestore) {
@@ -607,20 +545,4 @@ Y_UNIT_TEST_SUITE(BackupRestoreS3) {
607
545
);
608
546
}
609
547
610
- Y_UNIT_TEST (RestoreIndexTableSplitBoundaries) {
611
- TS3TestEnv testEnv;
612
- constexpr const char * table = " /Root/table" ;
613
- constexpr const char * index = " byValue" ;
614
- constexpr ui64 indexPartitions = 10 ;
615
-
616
- TestIndexTableSplitBoundariesArePreserved (
617
- table,
618
- index ,
619
- indexPartitions,
620
- testEnv.GetSession (),
621
- CreateBackupLambda (testEnv.GetDriver (), testEnv.GetS3Port ()),
622
- CreateRestoreLambda (testEnv.GetDriver (), testEnv.GetS3Port ())
623
- );
624
- }
625
-
626
548
}
0 commit comments