Skip to content
Snippets Groups Projects
Commit 51db4c1f authored by Matei Zaharia's avatar Matei Zaharia
Browse files

Merge pull request #453 from markhamstra/commutative

Change docs on 'reduce' since the merging of local reduces no longer pre...
parents b53174a6 b8863a79
No related branches found
No related tags found
No related merge requests found
...@@ -378,7 +378,7 @@ abstract class RDD[T: ClassManifest]( ...@@ -378,7 +378,7 @@ abstract class RDD[T: ClassManifest](
} }
/** /**
* Reduces the elements of this RDD using the specified associative binary operator. * Reduces the elements of this RDD using the specified commutative and associative binary operator.
*/ */
def reduce(f: (T, T) => T): T = { def reduce(f: (T, T) => T): T = {
val cleanF = sc.clean(f) val cleanF = sc.clean(f)
......
...@@ -201,7 +201,7 @@ trait JavaRDDLike[T, This <: JavaRDDLike[T, This]] extends PairFlatMapWorkaround ...@@ -201,7 +201,7 @@ trait JavaRDDLike[T, This <: JavaRDDLike[T, This]] extends PairFlatMapWorkaround
} }
/** /**
* Reduces the elements of this RDD using the specified associative binary operator. * Reduces the elements of this RDD using the specified commutative and associative binary operator.
*/ */
def reduce(f: JFunction2[T, T, T]): T = rdd.reduce(f) def reduce(f: JFunction2[T, T, T]): T = rdd.reduce(f)
......
...@@ -203,7 +203,7 @@ A complete list of transformations is available in the [RDD API doc](api/core/in ...@@ -203,7 +203,7 @@ A complete list of transformations is available in the [RDD API doc](api/core/in
<tr><th>Action</th><th>Meaning</th></tr> <tr><th>Action</th><th>Meaning</th></tr>
<tr> <tr>
<td> <b>reduce</b>(<i>func</i>) </td> <td> <b>reduce</b>(<i>func</i>) </td>
<td> Aggregate the elements of the dataset using a function <i>func</i> (which takes two arguments and returns one). The function should be associative so that it can be computed correctly in parallel. </td> <td> Aggregate the elements of the dataset using a function <i>func</i> (which takes two arguments and returns one). The function should be commutative and associative so that it can be computed correctly in parallel. </td>
</tr> </tr>
<tr> <tr>
<td> <b>collect</b>() </td> <td> <b>collect</b>() </td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment