Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/5855#discussion_r43822024
--- Diff: mllib/src/main/scala/org/apache/spark/mllib/rdd/SlidingRDD.scala
---
@@ -66,36 +69,54 @@ class SlidingRDD[T: ClassTag](@transient val parent:
RDD[T], val windowSize: Int
if (n == 0) {
Array.empty
} else if (n == 1) {
- Array(new SlidingRDDPartition[T](0, parentPartitions(0), Seq.empty))
+ Array(new SlidingRDDPartition[T](0, parentPartitions(0), Seq.empty,
0))
} else {
val n1 = n - 1
- val w1 = windowSize - 1
- // Get the first w1 items of each partition, starting from the
second partition.
- val nextHeads =
- parent.context.runJob(parent, (iter: Iterator[T]) =>
iter.take(w1).toArray, 1 until n)
+ // Get partitions sizes
--- End diff --
Keep the original implementation if `step == 1` to save one job.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]