Class Codes.IntersectDistinctRowSink

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

static class Codes.IntersectDistinctRowSink extends Codes.SetRowSink
Implementation of Codes.RowSink for a distinct intersect step.

The algorithm is as follows:

  1. Populate the map with (k, 0) for each key k from input 0;
  2. Read input 1, and for each key increments the count.
  3. If there is another input, first remove each key with count zero, and sets other keys' count to zero. Then repeat from step 1.
  4. Output all keys that have count greater than 0 from the last pass.