Skip to content

Commit 0df5517

Browse files
committed
moving test to MetastoreDataSourcesSuite
1 parent c31990c commit 0df5517

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,6 @@ class MetastoreDataSourcesSuite extends QueryTest with SQLTestUtils with TestHiv
993993
spark.sql("""drop database if exists testdb8156 CASCADE""")
994994
}
995995

996-
997996
test("skip hive metadata on table creation") {
998997
withTempDir { tempPath =>
999998
val schema = StructType((1 to 5).map(i => StructField(s"c_$i", StringType)))
@@ -1345,6 +1344,17 @@ class MetastoreDataSourcesSuite extends QueryTest with SQLTestUtils with TestHiv
13451344
}
13461345
}
13471346

1347+
Seq("orc", "parquet").foreach { format =>
1348+
test(s"SPARK-22146: read files containing special characters using $format") {
1349+
val nameWithSpecialChars = s"sp&cial%chars"
1350+
withTempDir { dir =>
1351+
val tmpFile = s"$dir/$nameWithSpecialChars"
1352+
spark.createDataset(Seq("a", "b")).write.format(format).save(tmpFile)
1353+
spark.read.format(format).load(tmpFile)
1354+
}
1355+
}
1356+
}
1357+
13481358
private def withDebugMode(f: => Unit): Unit = {
13491359
val previousValue = sparkSession.sparkContext.conf.get(DEBUG_MODE)
13501360
try {

sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcSourceSuite.scala

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -274,16 +274,4 @@ class OrcSourceSuite extends OrcSuite {
274274
)).get.toString
275275
}
276276
}
277-
278-
test("SPARK-22146: read ORC files containing special characters") {
279-
val dir = Utils.createTempDir().getCanonicalFile
280-
import spark.implicits._
281-
try {
282-
val nameWithSpecialChars = s"$dir/a%3Abad name.orc"
283-
spark.createDataset(Seq("a", "b")).write.format("orc").save(nameWithSpecialChars)
284-
spark.read.format("orc").load(nameWithSpecialChars)
285-
} finally {
286-
Utils.deleteRecursively(dir)
287-
}
288-
}
289277
}

0 commit comments

Comments
 (0)