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_r321017786
########## 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: You can detect an empty key by checking its size. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org