Skip to content

Commit 02c07e8

Browse files
dilipbiswalAndrew Or
authored andcommitted
[SPARK-14893][SQL] Re-enable HiveSparkSubmitSuite SPARK-8489 test after HiveContext is removed
## What changes were proposed in this pull request? Enable the test that was disabled when HiveContext was removed. ## How was this patch tested? Made sure the enabled test passes with the new jar. Author: Dilip Biswal <[email protected]> Closes #12924 from dilipbiswal/spark-14893.
1 parent 08db491 commit 02c07e8

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

sql/hive/src/test/resources/regression-test-SPARK-8489/Main.scala

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
import org.apache.spark.SparkContext
1918
import org.apache.spark.sql.SparkSession
2019

2120
/**
@@ -33,15 +32,18 @@ object Main {
3332
def main(args: Array[String]) {
3433
// scalastyle:off println
3534
println("Running regression test for SPARK-8489.")
36-
val sc = new SparkContext("local", "testing")
37-
val sparkSession = SparkSession.withHiveSupport(sc)
35+
val spark = SparkSession.builder
36+
.master("local")
37+
.appName("testing")
38+
.enableHiveSupport()
39+
.getOrCreate()
3840
// This line should not throw scala.reflect.internal.MissingRequirementError.
3941
// See SPARK-8470 for more detail.
40-
val df = sparkSession.createDataFrame(Seq(MyCoolClass("1", "2", "3")))
42+
val df = spark.createDataFrame(Seq(MyCoolClass("1", "2", "3")))
4143
df.collect()
4244
println("Regression test for SPARK-8489 success!")
4345
// scalastyle:on println
44-
sc.stop()
46+
spark.stop()
4547
}
4648
}
4749

Binary file not shown.
Binary file not shown.

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ class HiveSparkSubmitSuite
142142
runSparkSubmit(args)
143143
}
144144

145-
// TODO: re-enable this after rebuilding the jar (HiveContext was removed)
146-
ignore("SPARK-8489: MissingRequirementError during reflection") {
145+
test("SPARK-8489: MissingRequirementError during reflection") {
147146
// This test uses a pre-built jar to test SPARK-8489. In a nutshell, this test creates
148147
// a HiveContext and uses it to create a data frame from an RDD using reflection.
149148
// Before the fix in SPARK-8470, this results in a MissingRequirementError because

0 commit comments

Comments
 (0)