Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/5074#discussion_r26751288
--- Diff: docs/programming-guide.md ---
@@ -1022,6 +1022,27 @@ for details.
</tr>
</table>
+### Shuffle operations
+
+Certain operations within Spark trigger an operation known as the shuffle.
The shuffle is Spark's mechanism for re-distributing data so data with the same
key becomes co-located after a shuffle.
+
+#### Background
+
+To understand what happens during the shuffle we can consider the example
of the [`groupByKey`](#GroupByLink) operation. The `groupByKey` operation
generates a new RDD where all values for a single key are combined into a
2-tuple - the key and an Iterable object containing all the associated values.
If we think of the map and reduce steps for `groupByKey()` then we can see that
to generate the list of all values associated with a key, all of the values
must reside on the same reducer, since the output of the reduce step is the
complete array.
--- End diff --
Super nits: I think we can say tuple instead of 2-tuple to be consistent.
Also I like back-tick-quoting class names like `Iterable` when used as class
names.
Nit: I'd try to break away a bit from describing `groupByKey` as a
map-reduce. I would simplify to point out that not all values for one key
necessarily start out on the same partition or even machine, but must end up on
the same machine in order to present an array of them per key.
---
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]