Skip to content

Commit ce0e30c

Browse files
SPARK-3278 readability refactoring
1 parent f90c8c7 commit ce0e30c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

mllib/src/main/scala/org/apache/spark/mllib/regression/IsotonicRegression.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,11 @@ class PoolAdjacentViolators private [mllib]
185185
testData: RDD[(Double, Double, Double)],
186186
isotonic: Boolean): Seq[(Double, Double, Double)] = {
187187

188-
poolAdjacentViolators(
189-
testData
190-
.sortBy(_._2)
191-
.cache()
192-
.mapPartitions(it => poolAdjacentViolators(it.toArray, isotonic).toIterator)
193-
.collect(), isotonic)
188+
val parallelStepResult = testData
189+
.sortBy(_._2)
190+
.mapPartitions(it => poolAdjacentViolators(it.toArray, isotonic).toIterator)
191+
192+
poolAdjacentViolators(parallelStepResult.collect(), isotonic)
194193
}
195194
}
196195

0 commit comments

Comments
 (0)