You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gatorsmile <gi...@git.apache.org> on 2017/05/08 07:30:43 UTC

[GitHub] spark pull request #17858: [SPARK-20594][SQL]The staging directory should be...

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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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