Javadoc Javadoc

Takes a keyed collection of elements and produces a collection where each element consists of a key and an Iterable of all values associated with that key.

The results can be combined with windowing to subdivide each key based on time or triggering to produce partial aggregations. Either windowing or triggering is necessary when processing unbounded collections.

See more information in the Beam Programming Guide.


Example 1: (a, 1), (b, 2), (a, 3) will result into (a, [1, 3]), (b, [2]).

Example 2: Given a collection of customer orders keyed by postal code, you could use GroupByKey to get the collection of all orders in each postal code.