Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/15567#discussion_r84333278
--- Diff: core/src/main/scala/org/apache/spark/rdd/RDD.scala ---
@@ -787,14 +787,26 @@ abstract class RDD[T: ClassTag](
}
/**
- * [performance] Spark's internal mapPartitions method which skips
closure cleaning. It is a
- * performance API to be used carefully only if we are sure that the RDD
elements are
+ * [performance] Spark's internal mapPartitionsWithIndex method that
skips closure cleaning.
+ * It is a performance API to be used carefully only if we are sure that
the RDD elements are
* serializable and don't require closure cleaning.
*
* @param preservesPartitioning indicates whether the input function
preserves the partitioner,
* which should be `false` unless this is a pair RDD and the input
function doesn't modify
* the keys.
*/
+ private[spark] def mapPartitionsWithIndexInternal[U: ClassTag](
+ f: (Int, Iterator[T]) => Iterator[U],
+ preservesPartitioning: Boolean = false): RDD[U] = withScope {
+ new MapPartitionsRDD(
+ this,
+ (context: TaskContext, index: Int, iter: Iterator[T]) => f(index,
iter),
+ preservesPartitioning)
+ }
+
+ /**
+ * [performance] Spark's internal mapPartitions method that skips
closure cleaning.
+ */
private[spark] def mapPartitionsInternal[U: ClassTag](
--- End diff --
can we get rid of 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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]