You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by mengxr <gi...@git.apache.org> on 2015/11/04 00:18:34 UTC

[GitHub] spark pull request: [SPARK-7316] [MLlib] RDD sliding window with s...

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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org