From 6566c8b055e704de2ff0225828a76a39fa1c0bf9 Mon Sep 17 00:00:00 2001 From: Yu ISHIKAWA Date: Thu, 16 Jul 2015 15:40:40 +0900 Subject: [PATCH] Use `get`, instead of `apply` --- .../scala/org/apache/spark/ml/clustering/KMeansSuite.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mllib/src/test/scala/org/apache/spark/ml/clustering/KMeansSuite.scala b/mllib/src/test/scala/org/apache/spark/ml/clustering/KMeansSuite.scala index c93e06b349c4d..b631523fbf7f3 100644 --- a/mllib/src/test/scala/org/apache/spark/ml/clustering/KMeansSuite.scala +++ b/mllib/src/test/scala/org/apache/spark/ml/clustering/KMeansSuite.scala @@ -106,8 +106,7 @@ class KMeansSuite extends SparkFunSuite with MLlibTestSparkContext { transformed.columns.foreach { column => Array("features", predictionColName).contains(column) } - val clusters = transformed.select(predictionColName) - .map(row => row.apply(0)).distinct().collect().toSet + val clusters = transformed.select(predictionColName).map(_.get(0)).distinct().collect().toSet assert(clusters.size === k) assert(clusters === Set(0, 1, 2, 3, 4)) }