File tree Expand file tree Collapse file tree
src/main/scala/org/zouzias/spark/lucenerdd/spatial/shape/rdds Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,13 +112,9 @@ class ShapeRDD[K: ClassTag, V: ClassTag]
112112
113113 logDebug(" Compute topK linkage per partition" )
114114 val resultsByPart : RDD [(ShapeItemUUID , TopK [SparkScoreDoc ])] = partitionsRDD.flatMap {
115- case partition => queriesB.value.zipWithIndex.map { case (queryPoint, index) =>
116- val results = mapper(queryPoint, partition).map(x => topKMonoid.build(x))
117- .reduceOption(topKMonoid.plus)
118- .getOrElse(topKMonoid.zero)
119-
120- (index.toLong, results)
121- }
115+ case partition => queriesB.value.zipWithIndex.par.map { case (queryPoint, index) =>
116+ (index.toLong, topKMonoid.build(mapper(queryPoint, partition)))
117+ }.toIterator
122118 }
123119
124120 logDebug(" Merge topK linkage results" )
You can’t perform that action at this time.
0 commit comments