rdblue commented on a change in pull request #432: Allow writers to control 
size of files generated
URL: https://github.com/apache/incubator-iceberg/pull/432#discussion_r321017599
 
 

 ##########
 File path: spark/src/main/java/org/apache/iceberg/spark/source/Writer.java
 ##########
 @@ -425,17 +498,18 @@ public WriterCommitMessage commit() throws IOException {
 
     @Override
     public void abort() throws IOException {
+      closeCurrent();
+
       // clean up files created by this writer
       Tasks.foreach(completedFiles)
           .throwFailureWhenFinished()
           .noRetry()
           .run(file -> fileIo.deleteFile(file.path().toString()));
+    }
 
-      if (currentAppender != null) {
-        currentAppender.close();
-        this.currentAppender = null;
-        fileIo.deleteFile(currentFile.encryptingOutputFile());
-      }
+    private void openCurrent() {
 
 Review comment:
   It would be nice to share more code between the partitioned and 
unpartitioned writers, like the open and close methods. Is it possible to 
refactor so that these are shared and the unpartitioned writer uses an empty 
key?

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