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 2022/02/15 07:08:13 UTC

[GitHub] [iceberg] hililiwei commented on a change in pull request #2985: Core: Support committing delete files with multiple specs

hililiwei commented on a change in pull request #2985:
URL: https://github.com/apache/iceberg/pull/2985#discussion_r806504082



##########
File path: core/src/main/java/org/apache/iceberg/MergingSnapshotProducer.java
##########
@@ -200,21 +204,21 @@ protected void add(DataFile file) {
    * Add a delete file to the new snapshot.
    */
   protected void add(DeleteFile file) {
-    setWriteSpec(file);
-    addedFilesSummary.addedFile(writeSpec(), file);
+    Preconditions.checkNotNull(file, "Invalid delete file: null");
+    PartitionSpec fileSpec = ops.current().spec(file.specId());
+    List<DeleteFile> deleteFiles = newDeleteFilesBySpec.computeIfAbsent(file.specId(), specId -> Lists.newArrayList());
+    deleteFiles.add(file);

Review comment:
       Hello @aokolnychyi, may I ask, what is `deleteFiles`'s role here? It seems like it can be safely deleted?




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