lirui-apache commented on a change in pull request #15555:
URL: https://github.com/apache/flink/pull/15555#discussion_r611310039



##########
File path: 
flink-table/flink-table-runtime-blink/src/main/java/org/apache/flink/table/filesystem/FileSystemOutputFormat.java
##########
@@ -85,15 +85,26 @@ private FileSystemOutputFormat(
 
     @Override
     public void finalizeGlobal(int parallelism) {
+        Exception exception = null;
         try {
             FileSystemCommitter committer =
                     new FileSystemCommitter(
                             fsFactory, msFactory, overwrite, tmpPath, 
partitionColumns.length);
             committer.commitUpToCheckpoint(CHECKPOINT_ID);
         } catch (Exception e) {
-            throw new TableException("Exception in finalizeGlobal", e);
-        } finally {
-            new File(tmpPath.getPath()).delete();
+            exception = new TableException("Exception in finalizeGlobal", e);
+        }
+
+        // delete the temporary directory

Review comment:
       Why not keep this in the finally block?




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


Reply via email to