fbocse commented on a change in pull request #201: Add appendManifest to 
AppendFiles API.
URL: https://github.com/apache/incubator-iceberg/pull/201#discussion_r291466372
 
 

 ##########
 File path: core/src/main/java/org/apache/iceberg/ManifestWriter.java
 ##########
 @@ -31,9 +31,50 @@
 /**
  * Writer for manifest files.
  */
-class ManifestWriter implements FileAppender<DataFile> {
+public class ManifestWriter implements FileAppender<DataFile> {
   private static final Logger LOG = 
LoggerFactory.getLogger(ManifestWriter.class);
 
+  static ManifestFile copyAppendManifest(ManifestReader reader, OutputFile 
outputFile, long snapshotId,
+                                         SnapshotSummary.Builder 
summaryBuilder) {
+    ManifestWriter writer = new ManifestWriter(reader.spec(), outputFile, 
snapshotId);
+    boolean threw = true;
+    try {
+      for (ManifestEntry entry : reader.entries()) {
+        Preconditions.checkArgument(entry.status() == 
ManifestEntry.Status.ADDED,
+            "Cannot append manifest: contains existing files");
+        summaryBuilder.addedFile(reader.spec(), entry.file());
 
 Review comment:
   Will do

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to