LuciferYang commented on pull request #33556:
URL: https://github.com/apache/spark/pull/33556#issuecomment-890678015


   @Ngone51 However, I feel that these file operations seems redundant in some 
scenarios, except for the current pr
   
   For example:
   
   ```
   if (!success) {
           // This code path only happens if an exception was thrown above 
before we set success;
           // close our stuff and let the exception be thrown further
           writer.revertPartialWritesAndClose()
           if (file.exists()) {
             if (!file.delete()) {
               logWarning(s"Error deleting ${file}")
             }
           }
         }
   ```
   I don't understand why we need to truncate a file before deleting an 
unnecessary file. Therefore, I also want to add a boolean arg to the 
`revertPartialWritesAndClose ` method to control whether to do truncate 
operation.


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to