Class Codes.IntersectAllRowSink

All Implemented Interfaces:
Codes.RowSink, Describable
Enclosing class:
Codes

static class Codes.IntersectAllRowSink extends Codes.SetRowSink
Implementation of Codes.RowSink for a non-distinct intersect step.

The algorithm is as follows:

  1. Populate the map with (k, 1, 0) for each key k from input 0, and increment the count each time a key repeats.
  2. Read input 1, and populate the second count field.
  3. If there is another input, pass over the map, replacing each entry (k, x, y) with (k, min(x, y), 0), and removing all entries (k, x, 0). Then repeat from step 1.
  4. Output all keys min(x, y) times.