Spark: Add separate data and metadata file lists to RewriteTablePath#15382
Open
mxm wants to merge 5 commits intoapache:mainfrom
Open
Spark: Add separate data and metadata file lists to RewriteTablePath#15382mxm wants to merge 5 commits intoapache:mainfrom
mxm wants to merge 5 commits intoapache:mainfrom
Conversation
mxm
commented
Feb 20, 2026
Contributor
Author
pvary
reviewed
Feb 26, 2026
core/src/main/java/org/apache/iceberg/actions/BaseRewriteTablePath.java
Outdated
Show resolved
Hide resolved
pvary
reviewed
Feb 26, 2026
Comment on lines
+334
to
+335
| String fileListLocation = saveFileList(copyPlan, RESULT_LOCATION); | ||
| String dataFileListLocation = saveFileList(dataCopyPlan, DATA_FILE_LIST_DIR); |
Contributor
There was a problem hiding this comment.
Don't we afraid of the cost of duplicated file list write?
Contributor
Author
There was a problem hiding this comment.
We potentially write a lot of files (metadata, manifest lists, manifests), so writing two instead of one txt file looks ok to me.
pvary
reviewed
Feb 26, 2026
Comment on lines
-510
to
+532
| @Override | ||
| public RewriteContentFileResult append(RewriteResult<ContentFile<?>> r1) { | ||
| this.copyPlan().addAll(r1.copyPlan()); | ||
| this.toRewrite().addAll(r1.toRewrite()); | ||
|
|
||
| public RewriteContentFileResult append(RewriteContentFileResult other) { | ||
| this.copyPlan().addAll(other.copyPlan()); | ||
| this.toRewrite().addAll(other.toRewrite()); |
Contributor
Author
There was a problem hiding this comment.
The actual return type from where this is being called it RewriteContentFileResult, so I decided to narrow the type.
RewriteResult relies on generics which are subject to type erasure, see
It could be worthwhile to get rid of the types, since the different types aren't treated any different.6f88d67 to
9577ecd
Compare
Contributor
Author
|
Rebased to resolve conflicts with #15381. |
9577ecd to
356bebf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Downstream tools often need different copy strategies for data vs metadata files (e.g. different location, additional checks on data vs metadata files). This splits the file list into separate data and metadata lists while keeping the combined list for backward compatibility.