Skip to content

Commit feb3a9d

Browse files
chenghao-intelyhuai
authored andcommitted
[SPARK-7320] [SQL] [Minor] Move the testData into beforeAll()
Follow up of #6340, to avoid the test report missing once it fails. Author: Cheng Hao <[email protected]> Closes #6312 from chenghao-intel/rollup_minor and squashes the following commits: b03a25f [Cheng Hao] simplify the testData instantiation 09b7e8b [Cheng Hao] move the testData into beforeAll()
1 parent 1ee8eb4 commit feb3a9d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,21 @@
1717

1818
package org.apache.spark.sql.hive
1919

20-
import org.apache.spark.sql.QueryTest
20+
import org.apache.spark.sql.{DataFrame, QueryTest}
2121
import org.apache.spark.sql.functions._
2222
import org.apache.spark.sql.hive.test.TestHive
2323
import org.apache.spark.sql.hive.test.TestHive._
2424
import org.apache.spark.sql.hive.test.TestHive.implicits._
2525
import org.scalatest.BeforeAndAfterAll
2626

27-
case class TestData2Int(a: Int, b: Int)
28-
2927
// TODO ideally we should put the test suite into the package `sql`, as
3028
// `hive` package is optional in compiling, however, `SQLContext.sql` doesn't
3129
// support the `cube` or `rollup` yet.
3230
class HiveDataFrameAnalyticsSuite extends QueryTest with BeforeAndAfterAll {
33-
val testData =
34-
TestHive.sparkContext.parallelize(
35-
TestData2Int(1, 2) ::
36-
TestData2Int(2, 4) :: Nil).toDF()
31+
private var testData: DataFrame = _
3732

3833
override def beforeAll() {
34+
testData = Seq((1, 2), (2, 4)).toDF("a", "b")
3935
TestHive.registerDataFrameAsTable(testData, "mytable")
4036
}
4137

0 commit comments

Comments
 (0)