Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about?

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

val scratchDir = hadoopConf.get("hive.exec.scratchdir", "/tmp/hive")

val hiveQlTable = HiveClientImpl.toHiveTable(table)
Expand Down