spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pwendell <>
Subject [GitHub] spark pull request: [SPARK-1241] Add sliding to RDD
Date Sat, 15 Mar 2014 16:56:54 GMT
Github user pwendell commented on a diff in the pull request:
    --- Diff: core/src/main/scala/org/apache/spark/rdd/SlidedRDD.scala ---
    @@ -0,0 +1,102 @@
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.rdd
    +import scala.collection.mutable
    +import scala.reflect.ClassTag
    +import org.apache.spark.{TaskContext, Partition}
    +class SlidedRDDPartition[T](val idx: Int, val prev: Partition, val tail: Array[T])
    +  extends Partition with Serializable {
    +  override val index: Int = idx
    + * Represents a RDD from grouping items of its parent RDD in fixed size blocks by passing
a sliding
    + * window over them. The ordering is first based on the partition index and then the
ordering of
    + * items within each partition. This is similar to sliding in Scala collections, except
that it
    + * becomes an empty RDD if the window size is greater than the total number of items.
It needs to
    + * trigger a Spark job if the parent RDD has more than one partitions.
    + *
    + * @param parent the parent RDD
    + * @param windowSize the window size, must be greater than 1
    + *
    + * @see [[org.apache.spark.rdd.RDD#sliding]]
    + */
    +class SlidedRDD[T: ClassTag](@transient val parent: RDD[T], val windowSize: Int)
    --- End diff --
    I'm not sure "Slided" is word in english (Slide is an irregular verb). I think the past
participle of "Slide" is "Slid" or "Slidden". But in any case, maybe we could just call this

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

View raw message