dramaticlly commented on code in PR #19242:
URL: https://github.com/apache/iceberg/pull/19242#discussion_r4777738522


##########
spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteTablePathSparkAction.java:
##########
@@ -535,26 +530,11 @@ private RewriteResult<ManifestFile> rewriteManifestList(
     return result;
   }
 
-  private Set<String> manifestsToRewrite(
-      Set<Snapshot> deltaSnapshots, TableMetadata startMetadata) {
+  private void validateEndVersionManifests() {
     try {
       Table endStaticTable = newStaticTable(endVersionName, table.io());
-      Dataset<Row> lastVersionFiles = 
manifestDS(endStaticTable).select("path");
-      if (startMetadata == null) {
-        return 
Sets.newHashSet(lastVersionFiles.distinct().as(Encoders.STRING()).collectAsList());
-      } else {
-        Set<Long> deltaSnapshotIds =
-            
deltaSnapshots.stream().map(Snapshot::snapshotId).collect(Collectors.toSet());
-        return Sets.newHashSet(
-            lastVersionFiles
-                .distinct()
-                .filter(
-                    functions
-                        .column(ManifestFile.SNAPSHOT_ID.name())
-                        .isInCollection(deltaSnapshotIds))
-                .as(Encoders.STRING())
-                .collectAsList());
-      }
+      // read all manifest lists to fail fast on a missing one, without 
collecting to the driver
+      manifestDS(endStaticTable).select("path").count();

Review Comment:
   yeah I think this method now is simply a apply early validation of end 
version manifests lists to ensure they are readable and free of runtime IO 
problems down the line. I think like standard validation, return void on happy 
path and throw before next step, it help ensure snapshot validity before 
calculating the delta snapshots between start and end version for incremental 
copy



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