amogh-jahagirdar commented on code in PR #15470:
URL: https://github.com/apache/iceberg/pull/15470#discussion_r3486737112


##########
core/src/main/java/org/apache/iceberg/RewriteTablePathUtil.java:
##########
@@ -389,6 +395,52 @@ public static RewriteResult<DeleteFile> 
rewriteDeleteManifest(
       String targetPrefix,
       String stagingLocation)
       throws IOException {
+    return rewriteDeleteManifest(
+        manifestFile,
+        snapshotIds,
+        outputFile,
+        io,
+        format,
+        specsById,
+        sourcePrefix,
+        targetPrefix,
+        stagingLocation,
+        ImmutableMap.of());
+  }
+
+  /**
+   * Rewrite a delete manifest, replacing path references.
+   *
+   * <p>This is a metadata-only operation: position delete file content is 
rewritten separately (see
+   * {@link #rewritePositionDelete}). The actual sizes of those rewritten 
files are supplied via
+   * {@code rewrittenDeleteFileSizes} and recorded in the manifest so that 
{@code
+   * file_size_in_bytes} stays consistent with the rewritten file on disk.
+   *
+   * @param manifestFile source delete manifest to rewrite
+   * @param snapshotIds snapshot ids for filtering returned delete manifest 
entries
+   * @param outputFile output file to rewrite manifest file to
+   * @param io file io
+   * @param format format of the manifest file
+   * @param specsById map of partition specs by id
+   * @param sourcePrefix source prefix that will be replaced
+   * @param targetPrefix target prefix that will replace it
+   * @param stagingLocation staging location for rewritten position delete 
files
+   * @param rewrittenDeleteFileSizes map from source position delete file path 
to the actual size of
+   *     the rewritten file; entries absent from the map keep their original 
size
+   * @return a copy plan of content files in the manifest that was rewritten
+   */
+  public static RewriteResult<DeleteFile> rewriteDeleteManifest(

Review Comment:
   Ok I don't think we need to do it in this PR but after looking at this, 
these APIs are getting pretty unfortunate, we're passing in 10 arguments now. 
   
   I think we'll want to introduce some builders and some structure like 
RewriteContext, and have structures which kick back things like a 
DeleteManifestRewriter. 
   
   I think what I'm asking here is more fundamental changes (and possibly an 
overhaul/elimination of this Util class) so like I said, definitely for 
something in the future.



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