stevenzwu commented on code in PR #19105:
URL: https://github.com/apache/iceberg/pull/19105#discussion_r4673607650
##########
core/src/test/java/org/apache/iceberg/TestAppend.java:
##########
@@ -230,6 +231,38 @@ public void appendToUpgradedTable() throws IOException {
statuses(EntryStatus.ADDED, EntryStatus.EXISTING));
}
+ @ParameterizedTest
+ @ValueSource(ints = {1, 2})
+ void appendToTableUpgradedFromPreV3(int formatVersion) throws IOException {
+ Table table = create("upgraded_table", SCHEMA, SPEC, formatVersion);
Review Comment:
Done. The pre-v3 manifest is now merged (FILE_A existing, FILE_B added) and
the v4 commit is an empty append, so the next-row-id assertion covers both
existing and added rows.
##########
core/src/test/java/org/apache/iceberg/TestAppend.java:
##########
@@ -230,6 +231,38 @@ public void appendToUpgradedTable() throws IOException {
statuses(EntryStatus.ADDED, EntryStatus.EXISTING));
}
+ @ParameterizedTest
+ @ValueSource(ints = {1, 2})
+ void appendToTableUpgradedFromPreV3(int formatVersion) throws IOException {
+ Table table = create("upgraded_table", SCHEMA, SPEC, formatVersion);
+ table.newAppend().appendFile(FILE_A).commit();
+ long preV3SnapshotId = table.currentSnapshot().snapshotId();
+ ManifestFile preV3Manifest =
table.currentSnapshot().allManifests(io).get(0);
+ assertThat(preV3Manifest.firstRowId()).isNull();
+
+ InMemoryTables.Table upgraded = upgrade("upgraded_table", 4);
+ long firstRowId = upgraded.ops().current().nextRowId();
+ upgraded.newAppend().appendFile(FILE_B).commit();
Review Comment:
Done.
##########
core/src/test/java/org/apache/iceberg/TestAppend.java:
##########
@@ -230,6 +231,38 @@ public void appendToUpgradedTable() throws IOException {
statuses(EntryStatus.ADDED, EntryStatus.EXISTING));
}
+ @ParameterizedTest
+ @ValueSource(ints = {1, 2})
+ void appendToTableUpgradedFromPreV3(int formatVersion) throws IOException {
+ Table table = create("upgraded_table", SCHEMA, SPEC, formatVersion);
+ table.newAppend().appendFile(FILE_A).commit();
+ long preV3SnapshotId = table.currentSnapshot().snapshotId();
+ ManifestFile preV3Manifest =
table.currentSnapshot().allManifests(io).get(0);
+ assertThat(preV3Manifest.firstRowId()).isNull();
Review Comment:
Done, removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]