Skip to content

Commit 913d875

Browse files
committed
tests
1 parent 71444ec commit 913d875

File tree

2 files changed

+43
-2
lines changed

2 files changed

+43
-2
lines changed

paimon-core/src/test/java/org/apache/paimon/table/AppendOnlySimpleTableTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.apache.paimon.fs.local.LocalFileIO;
3737
import org.apache.paimon.io.BundleRecords;
3838
import org.apache.paimon.io.DataFileMeta;
39+
import org.apache.paimon.manifest.ManifestFileMeta;
3940
import org.apache.paimon.options.MemorySize;
4041
import org.apache.paimon.options.Options;
4142
import org.apache.paimon.predicate.Equal;
@@ -195,6 +196,22 @@ public void testDynamicBucketNoSelector() throws Exception {
195196
.isEmpty();
196197
}
197198

199+
@Test
200+
public void testMinMaxRowIdNull() throws Exception {
201+
writeData();
202+
FileStoreTable table = createFileStoreTable();
203+
List<ManifestFileMeta> manifests =
204+
table.store()
205+
.manifestListFactory()
206+
.create()
207+
.readDataManifests(table.latestSnapshot().get());
208+
assertThat(manifests.size()).isGreaterThan(0);
209+
for (ManifestFileMeta manifest : manifests) {
210+
assertThat(manifest.minRowId()).isNull();
211+
assertThat(manifest.maxRowId()).isNull();
212+
}
213+
}
214+
198215
@Test
199216
public void testReadDeletedFiles() throws Exception {
200217
writeData();

paimon-core/src/test/java/org/apache/paimon/table/DataEvolutionTableTest.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.apache.paimon.data.GenericRow;
2424
import org.apache.paimon.data.InternalRow;
2525
import org.apache.paimon.io.DataFileMeta;
26+
import org.apache.paimon.manifest.ManifestFileMeta;
2627
import org.apache.paimon.predicate.Predicate;
2728
import org.apache.paimon.predicate.PredicateBuilder;
2829
import org.apache.paimon.reader.DataEvolutionFileReader;
@@ -441,7 +442,8 @@ public void testWithRowIdsFilterManifests() throws Exception {
441442
public void innerTestWithRowIds(boolean compactManifests) throws Exception {
442443
createTableDefault();
443444
Schema schema = schemaDefault();
444-
BatchWriteBuilder builder = getTableDefault().newBatchWriteBuilder();
445+
FileStoreTable table = getTableDefault();
446+
BatchWriteBuilder builder = table.newBatchWriteBuilder();
445447

446448
// Write first batch of data with firstRowId = 0
447449
RowType writeType0 = schema.rowType().project(Arrays.asList("f0", "f1"));
@@ -481,9 +483,31 @@ public void innerTestWithRowIds(boolean compactManifests) throws Exception {
481483
try (BatchTableCommit commit = builder.newCommit()) {
482484
commit.compactManifests();
483485
}
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);
484508
}
485509

486-
ReadBuilder readBuilder = getTableDefault().newReadBuilder();
510+
ReadBuilder readBuilder = table.newReadBuilder();
487511

488512
// Test 1: Filter by row IDs that exist in the first file (0, 1)
489513
List<Long> rowIds1 = Arrays.asList(0L, 1L);

0 commit comments

Comments
 (0)