Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Map

Starts a map-reduce: runs a query on the input, ready for a Reduce.

Map and Reduce are Trill’s map-reduce operators. Map does not return a stream. It returns a map definition, and a Reduce always follows it.

  • Map(mapper).Reduce() runs the mapper and merges its output back into one stream.
  • Map(mapper, keySelector) also groups the mapper’s output by the key, so that the Reduce after it can run a query on each group.

In the diagram, the mapper is a Where, so the result is the same as Where’s.

See also: Reduce, GroupApply