Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/16137#discussion_r91937868
--- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
@@ -1949,20 +2038,35 @@ class SparkContext(config: SparkConf) extends
Logging {
/**
* Run a job on all partitions in an RDD and return the results in an
array.
+ *
+ * @param rdd target RDD to run tasks on
+ * @param func a function to run on each partition of the RDD
+ * @return in-memory collection with a result of the job (each
collection element will contain
+ * a result from one partition)
*/
def runJob[T, U: ClassTag](rdd: RDD[T], func: (TaskContext, Iterator[T])
=> U): Array[U] = {
runJob(rdd, func, 0 until rdd.partitions.length)
}
/**
- * Run a job on all partitions in an RDD and return the results in an
array.
+ * Run a job on all partitions in an RDD and return the results in an
array, but take a function
+ * of type `Iterator[T] => U` instead of `(TaskContext, Iterator[T]) =>
U`.
--- End diff --
That's pretty OK, though the type info is already documented. The prose
version of the difference is more like: this one's arg doesn't take a
`TaskContext` and the other one does.
---
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]