maropu commented on a change in pull request #28129: [SPARK-31346][SQL]Add new 
configuration to make sure temporary directory cleaned
URL: https://github.com/apache/spark/pull/28129#discussion_r403792505
 
 

 ##########
 File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/SaveAsHiveFile.scala
 ##########
 @@ -140,7 +141,9 @@ private[hive] trait SaveAsHiveFile extends 
DataWritingCommand {
     try {
       createdTempDir.foreach { path =>
         val fs = path.getFileSystem(hadoopConf)
-        if (fs.delete(path, true)) {
+        // Sometimes (e.g., when speculative task is enabled), temporary 
directories may be
+        // left uncleaned, confirmTempDirDeleted can confirm deleteOnExit.
+        if (fs.delete(path, true) && !SQLConf.get.confirmTempDirDeleted) {
 
 Review comment:
   If the description is true, we should check if `spark.speculation` is true 
or false here?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to