dramaticlly commented on code in PR #19044:
URL: https://github.com/apache/iceberg/pull/19044#discussion_r4645679385
##########
spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/actions/RewriteTablePathSparkAction.java:
##########
@@ -449,13 +451,28 @@ private Set<Pair<String, String>> rewriteVersionFile(
Pair.of(
stagingPath,
RewriteTablePathUtil.newPath(versionFilePath, sourcePrefix,
targetPrefix)));
+ return result;
+ }
- // include statistics files in copy plan
+ private Set<Pair<String, String>> statisticsFilesCopyPlan(
+ TableMetadata startMetadata, TableMetadata endMetadata) {
+ TableMetadata newEndMetadata =
+ RewriteTablePathUtil.replacePaths(endMetadata, sourcePrefix,
targetPrefix);
Review Comment:
I believe replacePaths is required here. In `rewriteVersionFile()`, we are
calling
`statsFileCopyPlan(metadata.statisticsFiles(),
newTableMetadata.statisticsFiles()));` before and now we are doing the same
with
`statsFileCopyPlan(endMetadata.statisticsFiles(),
newEndMetadata.statisticsFiles()));`
The copy plan contain pair which map to (src, target) and the desired target
path require path prefix replacement.
The only difference is that we filter out the stats file which already
exists in startMetadata.
--
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]