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

    https://github.com/apache/spark/pull/16134#discussion_r92244682
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveTable.scala
 ---
    @@ -328,6 +332,15 @@ case class InsertIntoHiveTable(
             holdDDLTime)
         }
     
    +    // Attempt to delete the staging directory and the inclusive files. If 
failed, the files are
    +    // expected to be dropped at the normal termination of VM since 
deleteOnExit is used.
    +    try {
    +      createdTempDir.foreach { path => 
path.getFileSystem(hadoopConf).delete(path, true) }
    +    } catch {
    +      case NonFatal(e) =>
    +        logWarning(s"Unable to delete staging directory: $stagingDir.\n" + 
e)
    +    }
    +
         // Invalidate the cache.
         sqlContext.sharedState.cacheManager.invalidateCache(table)
    --- End diff --
    
    should we delete the staging files before or after the invalidateCache? 
does it matter? logically, we should invalid cache first, then remove the 
intermediate dataset s.t the cache can be recovered from the file from disks. 
am i right? please clarify? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to