deleted the file were to store the csv files

This commit is contained in:
Miriam Baglioni 2020-05-28 10:04:10 +02:00
parent 669c05c771
commit 96d1a3c431
1 changed files with 2 additions and 3 deletions

View File

@ -76,10 +76,9 @@ public class ReadCSV implements Closeable {
Path hdfsWritePath = new Path(hdfsPath);
FSDataOutputStream fsDataOutputStream = null;
if (fileSystem.exists(hdfsWritePath)) {
fsDataOutputStream = fileSystem.append(hdfsWritePath);
} else {
fsDataOutputStream = fileSystem.create(hdfsWritePath);
fileSystem.delete(hdfsWritePath, false);
}
fsDataOutputStream = fileSystem.create(hdfsWritePath);
this.writer = new BufferedWriter(new OutputStreamWriter(fsDataOutputStream, StandardCharsets.UTF_8));
this.csvFile = httpConnector.getInputSource(fileURL);