nastra commented on code in PR #12630:
URL: https://github.com/apache/iceberg/pull/12630#discussion_r2009860257
##########
core/src/test/java/org/apache/iceberg/TestCommitReporting.java:
##########
@@ -170,35 +169,31 @@ public void addAndDeleteDeleteFiles() {
}
@TestTemplate
- public void addAndDeleteManifests() throws IOException {
+ public void addAndDeleteManifests() {
String tableName = "add-and-delete-manifests";
Table table =
TestTables.create(
tableDir, tableName, SCHEMA, SPEC, SortOrder.unsorted(),
formatVersion, reporter);
table.newAppend().appendFile(FILE_A).commit();
- Snapshot snap1 = table.currentSnapshot();
table.newAppend().appendFile(FILE_B).commit();
- Snapshot snap2 = table.currentSnapshot();
- ManifestFile newManifest =
- writeManifest(
- "manifest-file.avro",
- manifestEntry(ManifestEntry.Status.EXISTING, snap1.snapshotId(),
FILE_A),
- manifestEntry(ManifestEntry.Status.EXISTING, snap2.snapshotId(),
FILE_B));
-
- RewriteManifests rewriteManifests = table.rewriteManifests();
- for (ManifestFile manifest : snap2.dataManifests(table.io())) {
- rewriteManifests.deleteManifest(manifest);
- }
-
- rewriteManifests.addManifest(newManifest).commit();
+ table.rewriteManifests().clusterBy(file -> "file").rewriteIf(ignored ->
true).commit();
Review Comment:
just a tiny refactor to simplify rewriting manifests in this test
--
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]