Skip to content

Commit 95f740f

Browse files
committed
[SPARK-12653] Re-enable test "SPARK-8489: MissingRequirementError during reflection"
Current Error: ``` Exception in thread "main" java.lang.NoSuchMethodError: org.apache.spark.SparkContext$.$lessinit$greater$default$6()Lscala/collection/Map; ``` Scala 2.11 Error with test.jar built by Scala 2.10.5: ``` Exception in thread "main" java.lang.NoSuchMethodError: scala.reflect.api.JavaUniverse.runtimeMirror(Ljava/lang/ClassLoader;)Lscala/reflect/api/JavaMirrors$JavaMirror; ```
1 parent 643649d commit 95f740f

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import java.sql.Timestamp
2222
import java.util.Date
2323

2424
import scala.collection.mutable.ArrayBuffer
25+
import scala.tools.nsc.Properties
2526

2627
import org.scalatest.{BeforeAndAfterEach, Matchers}
2728
import org.scalatest.concurrent.Timeouts
@@ -87,13 +88,16 @@ class HiveSparkSubmitSuite
8788
runSparkSubmit(args)
8889
}
8990

90-
ignore("SPARK-8489: MissingRequirementError during reflection") {
91+
test("SPARK-8489: MissingRequirementError during reflection") {
9192
// This test uses a pre-built jar to test SPARK-8489. In a nutshell, this test creates
9293
// a HiveContext and uses it to create a data frame from an RDD using reflection.
9394
// Before the fix in SPARK-8470, this results in a MissingRequirementError because
9495
// the HiveContext code mistakenly overrides the class loader that contains user classes.
9596
// For more detail, see sql/hive/src/test/resources/regression-test-SPARK-8489/*scala.
96-
val testJar = "sql/hive/src/test/resources/regression-test-SPARK-8489/test.jar"
97+
import Properties.versionString
98+
val version = versionString.substring(versionString.indexOf(" ") + 1,
99+
versionString.lastIndexOf("."))
100+
val testJar = s"sql/hive/src/test/resources/regression-test-SPARK-8489/test-$version.jar"
97101
val args = Seq(
98102
"--conf", "spark.ui.enabled=false",
99103
"--conf", "spark.master.rest.enabled=false",

0 commit comments

Comments
 (0)