Skip to content

Commit

Permalink
Remove temp file
Browse files Browse the repository at this point in the history
  • Loading branch information
hvanhovell committed Feb 9, 2017
1 parent 2fa926d commit 21be4ca
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ abstract class OrcSuite extends QueryTest with TestHiveSingleton with BeforeAndA

test("SPARK-19459/SPARK-18220: read char/varchar column written by Hive") {
val hiveClient = spark.sharedState.externalCatalog.asInstanceOf[HiveExternalCatalog].client
val location = Utils.createTempDir().toURI
val location = Utils.createTempDir()
val uri = location.toURI
try {
hiveClient.runSqlHive(
"""
Expand All @@ -165,7 +166,7 @@ abstract class OrcSuite extends QueryTest with TestHiveSingleton with BeforeAndA
|STORED AS orc""".stripMargin)
// Hive throws an exception if I assign the location in the create table statement.
hiveClient.runSqlHive(
s"ALTER TABLE hive_orc SET LOCATION '$location'")
s"ALTER TABLE hive_orc SET LOCATION '$uri'")
hiveClient.runSqlHive(
"INSERT INTO TABLE hive_orc SELECT 'a', 'b', 'c' FROM (SELECT 1) t")

Expand All @@ -178,13 +179,14 @@ abstract class OrcSuite extends QueryTest with TestHiveSingleton with BeforeAndA
| b CHAR(10),
| c VARCHAR(10))
|STORED AS orc
|LOCATION '$location'""".stripMargin)
|LOCATION '$uri'""".stripMargin)
val result = Row("a", "b ", "c")
checkAnswer(spark.table("hive_orc"), result)
checkAnswer(spark.table("spark_orc"), result)
} finally {
hiveClient.runSqlHive("DROP TABLE IF EXISTS hive_orc")
hiveClient.runSqlHive("DROP TABLE IF EXISTS spark_orc")
Utils.deleteRecursively(location)
}
}
}
Expand Down

0 comments on commit 21be4ca

Please sign in to comment.