mbutrovich commented on code in PR #15470:
URL: https://github.com/apache/iceberg/pull/15470#discussion_r3453867970


##########
core/src/main/java/org/apache/iceberg/RewriteTablePathUtil.java:
##########
@@ -617,6 +682,37 @@ public static void rewritePositionDeleteFile(
       String targetPrefix,
       PositionDeleteReaderWriter posDeleteReaderWriter)
       throws IOException {
+    rewritePositionDeleteFileReturningLength(
+        deleteFile, outputFile, io, spec, sourcePrefix, targetPrefix, 
posDeleteReaderWriter);
+  }
+
+  /**
+   * Rewrite a position delete file, replacing path references, and return the 
size of the rewritten
+   * file.
+   *
+   * <p>The size is measured from the writer after it is closed (rather than 
via a separate {@code
+   * getLength()}/HEAD call), so it is accurate even on file systems where the 
length of an
+   * in-progress write underreports. Callers record this size as {@code 
file_size_in_bytes} in the
+   * rewritten manifest.
+   *
+   * @param deleteFile source position delete file to rewrite
+   * @param outputFile output file to write the rewritten delete file to
+   * @param io file io
+   * @param spec spec of delete file
+   * @param sourcePrefix source prefix that will be replaced
+   * @param targetPrefix target prefix to replace it
+   * @param posDeleteReaderWriter class to read and write position delete files
+   * @return the size in bytes of the rewritten file
+   */
+  public static long rewritePositionDeleteFileReturningLength(

Review Comment:
   Done. Renamed to `rewritePositionDelete`.



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