Skip to content

Commit 1ed228f

Browse files
committed
address comments.
1 parent 365ea26 commit 1ed228f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveTable.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ case class InsertIntoHiveTable(
8787
def output: Seq[Attribute] = Seq.empty
8888

8989
val hadoopConf = sessionState.newHadoopConf()
90-
val createdTempDir = new scala.collection.mutable.ArrayBuffer[Path]
90+
var createdTempDir: Option[Path] = None
9191
val stagingDir = hadoopConf.get("hive.exec.stagingdir", ".hive-staging")
9292

9393
private def executionId: String = {
@@ -114,7 +114,7 @@ case class InsertIntoHiveTable(
114114
if (!FileUtils.mkdir(fs, dir, true, hadoopConf)) {
115115
throw new IllegalStateException("Cannot create staging directory '" + dir.toString + "'")
116116
}
117-
createdTempDir += dir
117+
createdTempDir = Some(dir)
118118
fs.deleteOnExit(dir)
119119
} catch {
120120
case e: IOException =>

sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertIntoHiveTableSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class InsertIntoHiveTableSuite extends QueryTest with TestHiveSingleton with Bef
182182
val dir = path.listFiles()
183183
val folders = dir.filter(_.isDirectory).toList
184184
val filePaths = dir.map(_.getName).toList
185-
filePaths ::: folders.flatMap(listFiles)
185+
folders.flatMap(listFiles) ++: filePaths
186186
}
187187
val expectedFiles = ".part-00000.crc" :: "part-00000" :: Nil
188188
assert(listFiles(tmpDir).sortBy(_.toString) == expectedFiles)

0 commit comments

Comments
 (0)