Github user xuanyuanking commented on a diff in the pull request: https://github.com/apache/spark/pull/20244#discussion_r161141499 --- Diff: core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala --- @@ -96,6 +98,22 @@ class MyRDD( override def toString: String = "DAGSchedulerSuiteRDD " + id } +/** Wrapped rdd partition. */ +class WrappedPartition(val partition: Partition) extends Partition { + def index: Int = partition.index +} + +/** Wrapped rdd with WrappedPartition. */ +class WrappedRDD(parent: RDD[Int]) extends RDD[Int](parent) { + protected def getPartitions: Array[Partition] = { + parent.partitions.map(p => new WrappedPartition(p)) + } + + def compute(split: Partition, context: TaskContext): Iterator[Int] = { + parent.compute(split.asInstanceOf[WrappedPartition].partition, context) --- End diff -- I think this line is the key point for `WrppedPartition` and `WrappedRDD`, please give comments for explaining your intention.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org