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/03/03 02:38:18 UTC

[GitHub] [iceberg] openinx commented on a change in pull request #2271: Add position in manifest to DeleteFile's UT

openinx commented on a change in pull request #2271:
URL: https://github.com/apache/iceberg/pull/2271#discussion_r586062896



##########
File path: core/src/main/java/org/apache/iceberg/ManifestFiles.java
##########
@@ -121,6 +121,17 @@ private ManifestFiles() {
     throw new UnsupportedOperationException("Cannot write manifest for table version: " + formatVersion);
   }
 
+  /**
+   * Returns a new {@link ManifestReader} for a {@link ManifestFile}.
+   *
+   * @param manifest a {@link ManifestFile}
+   * @param io a {@link FileIO}
+   * @return a {@link ManifestReader}
+   */
+  public static ManifestReader<DeleteFile> readDeleteManifest(ManifestFile manifest, FileIO io) {

Review comment:
       I think so ,  if people don't provide a `specsById`, then it good to parse the spec from table's metadata and get the partition specification.  The  FlinkManifestUtil#readCompletedFiles is deserializing the DeleteFiles from delete manifest files by using the `readDeleteManifest(manifest, io, null);`

##########
File path: core/src/test/java/org/apache/iceberg/TestManifestReader.java
##########
@@ -131,4 +131,16 @@ public void testDataFilePositions() throws IOException {
       }
     }
   }
+
+  @Test
+  public void testDeleteFilePositions() throws IOException {

Review comment:
       The unit test looks good to me. 

##########
File path: core/src/test/java/org/apache/iceberg/TableTestBase.java
##########
@@ -214,6 +214,23 @@ ManifestFile writeManifest(Long snapshotId, ManifestEntry<?>... entries) throws
     return writer.toManifestFile();
   }
 
+  @SuppressWarnings("checkstyle:HiddenField")
+  ManifestFile writeDeleteManifest(int formatVersion, Long snapshotId, DeleteFile... deleteFiles)

Review comment:
       Seems like we've already provided a `writeManifest` to write DeleteFiles into delete manifests (https://github.com/apache/iceberg/pull/2271/files#diff-65ca95dcbe2f4bca89bc9454f5434afa4d054a97ae76f01c6a224a41a749a1b2R192) ?   So seems we don't have to provide another `writeDeleteManifest`  ? 




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

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