Skip to content

Commit 6ffc389

Browse files
committed
try to fix unit test
1 parent a59d8b7 commit 6ffc389

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mllib/src/test/scala/org/apache/spark/ml/classification/LogisticRegressionSuite.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,19 @@ package org.apache.spark.ml.classification
1919

2020
import org.scalatest.{BeforeAndAfterAll, FunSuite}
2121

22-
import org.apache.spark.sql.SchemaRDD
2322
import org.apache.spark.mllib.classification.LogisticRegressionSuite.generateLogisticInput
23+
import org.apache.spark.sql.SchemaRDD
2424
import org.apache.spark.sql.test.TestSQLContext._
2525

2626
class LogisticRegressionSuite extends FunSuite with BeforeAndAfterAll with Serializable {
2727

28-
var dataset: SchemaRDD = _
28+
@transient var dataset: SchemaRDD = _
2929

3030
override def beforeAll(): Unit = {
3131
super.beforeAll()
3232
val points = generateLogisticInput(1.0, 1.0, 100, 42)
33-
dataset = sparkContext.parallelize(points, 2)
33+
val rdd = sparkContext.parallelize(points)
34+
dataset = createSchemaRDD(rdd)
3435
}
3536

3637
test("logistic regression") {

0 commit comments

Comments
 (0)