You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/08/06 15:36:49 UTC
[GitHub] [iceberg] RussellSpitzer commented on a change in pull request #2932: delete file by mistake when rewriting iceberg table throw CommitStateUnknownException
RussellSpitzer commented on a change in pull request #2932:
URL: https://github.com/apache/iceberg/pull/2932#discussion_r684328767
##########
File path: core/src/main/java/org/apache/iceberg/actions/BaseRewriteDataFilesAction.java
##########
@@ -271,20 +272,30 @@ public RewriteDataFilesActionResult execute() {
private void replaceDataFiles(Iterable<DataFile> deletedDataFiles, Iterable<DataFile> addedDataFiles,
long startingSnapshotId) {
try {
- RewriteFiles rewriteFiles = table.newRewrite()
- .validateFromSnapshot(startingSnapshotId)
- .rewriteFiles(Sets.newHashSet(deletedDataFiles), Sets.newHashSet(addedDataFiles));
- commit(rewriteFiles);
+ doReplace(deletedDataFiles, addedDataFiles, startingSnapshotId);
Review comment:
I'm not sure if the modules work out correctly for this, but it may make sense to use RewriteDataFilesCommitter (https://github.com/apache/iceberg/blob/a1bd63d56751999ecee89b871992d7bac395fd52/core/src/main/java/org/apache/iceberg/actions/RewriteDataFilesCommitManager.java#L57) here and re-use the commit code from the new path.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org