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 2019/11/11 23:05:42 UTC

[GitHub] [incubator-iceberg] rdblue commented on a change in pull request #512: Extend RewriteManifests with a way to add/delete manifests

rdblue commented on a change in pull request #512: Extend RewriteManifests with a way to add/delete manifests
URL: https://github.com/apache/incubator-iceberg/pull/512#discussion_r344950187
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/BaseRewriteManifests.java
 ##########
 @@ -113,65 +119,98 @@ public RewriteManifests rewriteIf(Predicate<ManifestFile> pred) {
   }
 
   @Override
-  public List<ManifestFile> apply(TableMetadata base) {
-    Preconditions.checkNotNull(clusterByFunc, "clusterBy function cannot be null");
+  public RewriteManifests deleteManifest(ManifestFile manifest) {
+    deletedManifests.add(manifest);
+    return this;
+  }
+
+  @Override
+  public RewriteManifests addManifest(ManifestFile manifest) {
+    // the manifest must be rewritten with this update's snapshot ID
+    Map<Integer, PartitionSpec> specsById = ops.current().specsById();
+    try (ManifestReader reader = ManifestReader.read(ops.io().newInputFile(manifest.path()), specsById)) {
+      Set<ManifestEntry.Status> allowedStatuses = Sets.newHashSet(ManifestEntry.Status.EXISTING);
 
 Review comment:
   Nit: this could be a static final constant.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org