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

    https://github.com/apache/spark/pull/17858#discussion_r115188063
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveTable.scala
 ---
    @@ -222,7 +222,7 @@ case class InsertIntoHiveTable(
         val externalCatalog = sparkSession.sharedState.externalCatalog
         val hiveVersion = 
externalCatalog.asInstanceOf[HiveExternalCatalog].client.version
         val hadoopConf = sessionState.newHadoopConf()
    -    val stagingDir = hadoopConf.get("hive.exec.stagingdir", 
".hive-staging")
    +    val stagingDir = hadoopConf.get("hive.exec.stagingdir", 
".hive-staging") + "/.hive-staging"
    --- End diff --
    
    How about?
    
    ```Scala
        // SPARK-20594 After Hive 1.1, Hive will create the staging directory 
under the table directory,
        // and when moving staging directory to table directory, Hive will 
still empty the table
        // directory, but will exclude the staging directory, which start with 
"." or "_".
        val stagingDir =
          new Path(hadoopConf.get("hive.exec.stagingdir", ".hive-staging"), 
".hive-staging").toString
    ```


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