Skip to content

Commit

Permalink
[FLINK-20230][table] FileSystemOutputFormat should delete file using …
Browse files Browse the repository at this point in the history
…FileSystemFactory

This closes apache#15541
  • Loading branch information
JingsongLi authored Apr 12, 2021
1 parent 73f66d9 commit 562f31a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.apache.flink.streaming.api.functions.sink.filesystem.OutputFileConfig;
import org.apache.flink.table.api.TableException;

import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.util.LinkedHashMap;
Expand Down Expand Up @@ -93,7 +92,10 @@ public void finalizeGlobal(int parallelism) {
} catch (Exception e) {
throw new TableException("Exception in finalizeGlobal", e);
} finally {
new File(tmpPath.getPath()).delete();
try {
fsFactory.create(tmpPath.toUri()).delete(tmpPath, true);
} catch (IOException ignore) {
}
}
}

Expand Down

0 comments on commit 562f31a

Please sign in to comment.