ebyhr commented on code in PR #14186:
URL: https://github.com/apache/iceberg/pull/14186#discussion_r2383735246
##########
core/src/test/java/org/apache/iceberg/TestReplacePartitions.java:
##########
@@ -198,6 +215,40 @@ public void testReplaceWithUnpartitionedTable() throws
IOException {
statuses(Status.DELETED));
}
+ @TestTemplate
+ public void testReplaceAllVoidUnpartitionedTable() throws IOException {
+ Table tableVoid =
+ TestTables.create(tableDir, "allvoidUnpartitioned", SCHEMA,
SPEC_ALL_VOID, formatVersion);
+
+ commit(tableVoid,
tableVoid.newAppend().appendFile(FILE_ALL_VOID_UNPARTITIONED_A), branch);
+ validateSnapshot(
+ null,
+ latestSnapshot(TestTables.readMetadata("allvoidUnpartitioned"),
branch),
+ FILE_ALL_VOID_UNPARTITIONED_A);
+
+ ReplacePartitions replacePartitions =
+
tableVoid.newReplacePartitions().addFile(FILE_ALL_VOID_UNPARTITIONED_B);
+ commit(tableVoid, replacePartitions, branch);
+
+
assertThat(TestTables.metadataVersion("allvoidUnpartitioned")).isEqualTo(2);
+ TableMetadata replaceMetadata =
TestTables.readMetadata("allvoidUnpartitioned");
+ long replaceId = latestSnapshot(replaceMetadata, branch).snapshotId();
+
+ assertThat(latestSnapshot(replaceMetadata,
branch).allManifests(tableVoid.io())).hasSize(2);
+
+ validateManifestEntries(
+ latestSnapshot(replaceMetadata,
branch).allManifests(tableVoid.io()).get(0),
+ ids(replaceId),
+ files(FILE_ALL_VOID_UNPARTITIONED_B),
+ statuses(Status.ADDED));
+
+ validateManifestEntries(
+ latestSnapshot(replaceMetadata,
branch).allManifests(tableVoid.io()).get(1),
Review Comment:
We could extract a variable for `latestSnapshot(replaceMetadata,
branch).allManifests(tableVoid.io())`
##########
core/src/test/java/org/apache/iceberg/TestReplacePartitions.java:
##########
@@ -198,6 +215,40 @@ public void testReplaceWithUnpartitionedTable() throws
IOException {
statuses(Status.DELETED));
}
+ @TestTemplate
+ public void testReplaceAllVoidUnpartitionedTable() throws IOException {
Review Comment:
`throws IOException` is redundant.
--
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]