stczwd 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_r403804732
 
 

 ##########
 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:
   @maropu Thanks for reply. In my scenario it was indeed caused by 
`spark.speculation`, but I don’t know if there are any other scenarios also 
happened in this.
   If it only happened with `spark.speculation`, then we can just check 
`spark.speculation` instead of adding new configuration.

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