Skip to content

Commit 09b7e8b

Browse files
move the testData into beforeAll()
1 parent 8ddcb25 commit 09b7e8b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
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._
@@ -30,12 +30,12 @@ case class TestData2Int(a: Int, b: Int)
3030
// `hive` package is optional in compiling, however, `SQLContext.sql` doesn't
3131
// support the `cube` or `rollup` yet.
3232
class HiveDataFrameAnalyticsSuite extends QueryTest with BeforeAndAfterAll {
33-
val testData =
34-
TestHive.sparkContext.parallelize(
35-
TestData2Int(1, 2) ::
36-
TestData2Int(2, 4) :: Nil).toDF()
33+
private var testData: DataFrame = _
3734

3835
override def beforeAll() {
36+
testData = sparkContext.parallelize(
37+
TestData2Int(1, 2) ::
38+
TestData2Int(2, 4) :: Nil).toDF()
3939
TestHive.registerDataFrameAsTable(testData, "mytable")
4040
}
4141

0 commit comments

Comments
 (0)