Github user xuchuanyin commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1994#discussion_r170245277
  
    --- Diff: 
core/src/test/java/org/apache/carbondata/core/carbon/datastorage/filesystem/store/impl/DFSFileReaderImplUnitTest.java
 ---
    @@ -50,21 +49,21 @@
         file = new File("Test.carbondata");
         fileWithEmptyContent = new File("TestEXception.carbondata");
     
    -    if (!file.exists()) try {
    -      file.createNewFile();
    -    } catch (IOException e) {
    -      e.printStackTrace();
    +    if (file.exists()) {
    +      file.delete();
         }
         if (!fileWithEmptyContent.exists()) try {
           fileWithEmptyContent.createNewFile();
         } catch (IOException e) {
           e.printStackTrace();
         }
         try {
    -      FileOutputStream of = new FileOutputStream(file, true);
    +      FileOutputStream of = new FileOutputStream(file, false);
    --- End diff --
    
    FYI:
    Create a brand new file and write to it. Remember to close the stream, 
otherwise deleting/renaming the file will cause failure.


---

Reply via email to