Github user rxin commented on a diff in the pull request:
    --- Diff: core/src/main/scala/org/apache/spark/rdd/ZippedWithIndexRDD.scala 
    @@ -64,8 +64,14 @@ class ZippedWithIndexRDD[T: ClassTag](prev: RDD[T]) 
extends RDD[(T, Long)](prev)
       override def compute(splitIn: Partition, context: TaskContext): 
Iterator[(T, Long)] = {
         val split = splitIn.asInstanceOf[ZippedWithIndexRDDPartition]
    -    firstParent[T].iterator(split.prev, context) { x =>
    -      (x._1, split.startIndex + x._2)
    +    val parentIter = firstParent[T].iterator(split.prev, context)
    +    new Iterator[(T, Long)] {
    +      var idxAcc: Long = -1L
    --- End diff --
    also why don't we initialize this to split.startIndex?
    I'd also rename this just "index"

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.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to