timothyw553 commented on code in PR #19114:
URL: https://github.com/apache/iceberg/pull/19114#discussion_r4704355408


##########
spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/actions/RepairTableSparkAction.java:
##########
@@ -314,18 +332,26 @@ private Dataset<Row> 
buildManifestEntryDF(List<ManifestFile> manifests) {
         manifestDF, 
manifestDF.col("manifest").equalTo(entryDF.col("manifest")), "left_semi");
   }
 
-  private List<ManifestFile> writeManifests(
+  private WriteManifests.WrittenManifests writeManifests(
       RepairContext context, int specId, Dataset<Row> entryDF, 
List<ManifestFile> manifests) {
     ManifestWriterFactory writers = manifestWriters(context.tableBroadcast(), 
specId);
     WriteManifests<?> writeFunc =
         context.content() == ManifestContent.DATA
             ? new WriteDataManifests(writers, manifests, context)
             : new WriteDeleteManifests(writers, manifests, context);
 
+    List<ManifestFile> written = Lists.newArrayList();
+    Map<String, Long> totalDeltas = Maps.newHashMap();
     // keeps the table's layout
-    return writeFunc
-        .apply(entryDF.repartition(manifests.size(), entryDF.col("manifest")))
-        .collectAsList();
+    for (WriteManifests.WrittenManifests task :
+        writeFunc
+            .apply(entryDF.repartition(manifests.size(), 
entryDF.col("manifest")))
+            .collectAsList()) {
+      written.addAll(task.manifests());
+      task.totalDeltas().forEach((total, delta) -> totalDeltas.merge(total, 
delta, Long::sum));

Review Comment:
   the tests that check totals only repair one manifest per content/spec group, 
and the two-manifest test doesn't check totals. could we add tests with 
multiple repaired manifests in the same group, covering both multiple manifests 
in one task and multiple tasks, and verify the final totals against sums from 
the original files?



-- 
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]

Reply via email to