|
23 | 23 | import org.apache.paimon.data.GenericRow; |
24 | 24 | import org.apache.paimon.data.InternalRow; |
25 | 25 | import org.apache.paimon.io.DataFileMeta; |
| 26 | +import org.apache.paimon.manifest.ManifestFileMeta; |
26 | 27 | import org.apache.paimon.predicate.Predicate; |
27 | 28 | import org.apache.paimon.predicate.PredicateBuilder; |
28 | 29 | import org.apache.paimon.reader.DataEvolutionFileReader; |
@@ -441,7 +442,8 @@ public void testWithRowIdsFilterManifests() throws Exception { |
441 | 442 | public void innerTestWithRowIds(boolean compactManifests) throws Exception { |
442 | 443 | createTableDefault(); |
443 | 444 | Schema schema = schemaDefault(); |
444 | | - BatchWriteBuilder builder = getTableDefault().newBatchWriteBuilder(); |
| 445 | + FileStoreTable table = getTableDefault(); |
| 446 | + BatchWriteBuilder builder = table.newBatchWriteBuilder(); |
445 | 447 |
|
446 | 448 | // Write first batch of data with firstRowId = 0 |
447 | 449 | RowType writeType0 = schema.rowType().project(Arrays.asList("f0", "f1")); |
@@ -481,9 +483,31 @@ public void innerTestWithRowIds(boolean compactManifests) throws Exception { |
481 | 483 | try (BatchTableCommit commit = builder.newCommit()) { |
482 | 484 | commit.compactManifests(); |
483 | 485 | } |
| 486 | + |
| 487 | + List<ManifestFileMeta> manifests = |
| 488 | + table.store() |
| 489 | + .manifestListFactory() |
| 490 | + .create() |
| 491 | + .readDataManifests(table.latestSnapshot().get()); |
| 492 | + assertThat(manifests.size()).isEqualTo(1); |
| 493 | + assertThat(manifests.get(0).minRowId()).isEqualTo(0); |
| 494 | + assertThat(manifests.get(0).maxRowId()).isEqualTo(5); |
| 495 | + } else { |
| 496 | + List<ManifestFileMeta> manifests = |
| 497 | + table.store() |
| 498 | + .manifestListFactory() |
| 499 | + .create() |
| 500 | + .readDataManifests(table.latestSnapshot().get()); |
| 501 | + assertThat(manifests.size()).isEqualTo(3); |
| 502 | + assertThat(manifests.get(0).minRowId()).isEqualTo(0); |
| 503 | + assertThat(manifests.get(0).maxRowId()).isEqualTo(1); |
| 504 | + assertThat(manifests.get(1).minRowId()).isEqualTo(2); |
| 505 | + assertThat(manifests.get(1).maxRowId()).isEqualTo(3); |
| 506 | + assertThat(manifests.get(2).minRowId()).isEqualTo(4); |
| 507 | + assertThat(manifests.get(2).maxRowId()).isEqualTo(5); |
484 | 508 | } |
485 | 509 |
|
486 | | - ReadBuilder readBuilder = getTableDefault().newReadBuilder(); |
| 510 | + ReadBuilder readBuilder = table.newReadBuilder(); |
487 | 511 |
|
488 | 512 | // Test 1: Filter by row IDs that exist in the first file (0, 1) |
489 | 513 | List<Long> rowIds1 = Arrays.asList(0L, 1L); |
|
0 commit comments