@@ -167,7 +167,8 @@ public void testTableCleanup() throws IOException {
167
167
taskEntity2 -> taskEntity2 .getTaskType ())
168
168
.returns (
169
169
new ManifestFileCleanupTaskHandler .ManifestCleanupTask (
170
- tableIdentifier , List .of (statisticsFile .path ())),
170
+ tableIdentifier ,
171
+ List .of (snapshot .manifestListLocation (), statisticsFile .path ())),
171
172
entity ->
172
173
entity .readData (
173
174
ManifestFileCleanupTaskHandler .ManifestCleanupTask .class )));
@@ -224,7 +225,7 @@ public void close() {
224
225
.getOrCreateMetaStoreManager (realmContext )
225
226
.loadTasks (callContext .getPolarisCallContext (), "test" , 5 )
226
227
.getEntities ())
227
- .hasSize (1 );
228
+ .hasSize (2 );
228
229
}
229
230
230
231
@ Test
@@ -285,15 +286,41 @@ public void close() {
285
286
.getOrCreateMetaStoreManager (realmContext )
286
287
.loadTasks (callContext .getPolarisCallContext (), "test" , 5 )
287
288
.getEntities ())
288
- .hasSize (2 )
289
+ .hasSize (4 )
289
290
.satisfiesExactly (
290
291
taskEntity ->
291
292
assertThat (taskEntity )
292
293
.returns (PolarisEntityType .TASK .getCode (), PolarisBaseEntity ::getTypeCode )
293
294
.extracting (TaskEntity ::of )
294
295
.returns (
295
- AsyncTaskType .MANIFEST_FILE_CLEANUP ,
296
+ AsyncTaskType .METADATA_FILE_BATCH_CLEANUP ,
296
297
taskEntity1 -> taskEntity1 .getTaskType ())
298
+ .returns (
299
+ new ManifestFileCleanupTaskHandler .ManifestCleanupTask (
300
+ tableIdentifier , List .of (snapshot .manifestListLocation ())),
301
+ entity ->
302
+ entity .readData (
303
+ ManifestFileCleanupTaskHandler .ManifestCleanupTask .class )),
304
+ taskEntity ->
305
+ assertThat (taskEntity )
306
+ .returns (PolarisEntityType .TASK .getCode (), PolarisBaseEntity ::getTypeCode )
307
+ .extracting (TaskEntity ::of )
308
+ .returns (
309
+ AsyncTaskType .METADATA_FILE_BATCH_CLEANUP ,
310
+ taskEntity2 -> taskEntity2 .getTaskType ())
311
+ .returns (
312
+ new ManifestFileCleanupTaskHandler .ManifestCleanupTask (
313
+ tableIdentifier , List .of (snapshot .manifestListLocation ())),
314
+ entity ->
315
+ entity .readData (
316
+ ManifestFileCleanupTaskHandler .ManifestCleanupTask .class )),
317
+ taskEntity ->
318
+ assertThat (taskEntity )
319
+ .returns (PolarisEntityType .TASK .getCode (), PolarisBaseEntity ::getTypeCode )
320
+ .extracting (TaskEntity ::of )
321
+ .returns (
322
+ AsyncTaskType .MANIFEST_FILE_CLEANUP ,
323
+ taskEntity3 -> taskEntity3 .getTaskType ())
297
324
.returns (
298
325
new ManifestFileCleanupTaskHandler .ManifestCleanupTask (
299
326
tableIdentifier ,
@@ -307,7 +334,7 @@ public void close() {
307
334
.extracting (TaskEntity ::of )
308
335
.returns (
309
336
AsyncTaskType .MANIFEST_FILE_CLEANUP ,
310
- taskEntity2 -> taskEntity2 .getTaskType ())
337
+ taskEntity4 -> taskEntity4 .getTaskType ())
311
338
.returns (
312
339
new ManifestFileCleanupTaskHandler .ManifestCleanupTask (
313
340
tableIdentifier ,
@@ -413,7 +440,11 @@ public void testTableCleanupMultipleSnapshots() throws IOException {
413
440
.returns (
414
441
new ManifestFileCleanupTaskHandler .ManifestCleanupTask (
415
442
tableIdentifier ,
416
- List .of (statisticsFile1 .path (), statisticsFile2 .path ())),
443
+ List .of (
444
+ snapshot .manifestListLocation (),
445
+ snapshot2 .manifestListLocation (),
446
+ statisticsFile1 .path (),
447
+ statisticsFile2 .path ())),
417
448
entity ->
418
449
entity .readData (
419
450
ManifestFileCleanupTaskHandler .ManifestCleanupTask .class )));
@@ -569,7 +600,11 @@ public void testTableCleanupMultipleMetadata() throws IOException {
569
600
new ManifestFileCleanupTaskHandler .ManifestCleanupTask (
570
601
tableIdentifier ,
571
602
List .of (
572
- firstMetadataFile , statisticsFile1 .path (), statisticsFile2 .path ())),
603
+ firstMetadataFile ,
604
+ snapshot .manifestListLocation (),
605
+ snapshot2 .manifestListLocation (),
606
+ statisticsFile1 .path (),
607
+ statisticsFile2 .path ())),
573
608
entity ->
574
609
entity .readData (
575
610
ManifestFileCleanupTaskHandler .ManifestCleanupTask .class )));
0 commit comments