nastra commented on code in PR #14351:
URL: https://github.com/apache/iceberg/pull/14351#discussion_r2502686523


##########
core/src/main/java/org/apache/iceberg/RewriteTablePathUtil.java:
##########
@@ -592,6 +641,66 @@ record = recordIt.next();
     }
   }
 
+  /**
+   * Rewrite a DV (Deletion Vector) file, updating the referenced data file 
paths in blob metadata.
+   *
+   * @param deleteFile source DV file to be rewritten
+   * @param outputFile output file to write the rewritten DV to
+   * @param io file io
+   * @param sourcePrefix source prefix that will be replaced
+   * @param targetPrefix target prefix to replace it
+   */
+  private static void rewriteDVFile(
+      DeleteFile deleteFile,
+      OutputFile outputFile,
+      FileIO io,
+      String sourcePrefix,
+      String targetPrefix)
+      throws IOException {
+    InputFile sourceFile = io.newInputFile(deleteFile.location());
+
+    try (org.apache.iceberg.puffin.PuffinReader reader =

Review Comment:
   I think it would be better to not mix the reader and writer here. First read 
the blobs, then rewrite them and store them in a list and only then init the 
writer to write the new blobs out



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