Package net.hydromatic.morel.eval
Class Codes.IntersectAllRowSink
java.lang.Object
net.hydromatic.morel.eval.Codes.BaseRowSink
net.hydromatic.morel.eval.Codes.SetRowSink
net.hydromatic.morel.eval.Codes.IntersectAllRowSink
- All Implemented Interfaces:
Codes.RowSink,Describable
- Enclosing class:
Codes
Implementation of
Codes.RowSink for a non-distinct intersect
step.
The algorithm is as follows:
- Populate the map with (k, 1, 0) for each key k from input 0, and increment the count each time a key repeats.
- Read input 1, and populate the second count field.
- 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.
- Output all keys min(x, y) times.
-
Field Summary
Fields inherited from class net.hydromatic.morel.eval.Codes.SetRowSink
codes, distinct, map, names, op, valuesFields inherited from class net.hydromatic.morel.eval.Codes.BaseRowSink
rowSink -
Constructor Summary
ConstructorsConstructorDescriptionIntersectAllRowSink(com.google.common.collect.ImmutableList<Code> codes, com.google.common.collect.ImmutableList<String> names, Codes.RowSink rowSink) -
Method Summary
Methods inherited from class net.hydromatic.morel.eval.Codes.SetRowSink
add, compute, computeIfAbsent, computeIfPresent, dec, describe, inc, removeMethods inherited from class net.hydromatic.morel.eval.Codes.BaseRowSink
start
-
Constructor Details
-
IntersectAllRowSink
IntersectAllRowSink(com.google.common.collect.ImmutableList<Code> codes, com.google.common.collect.ImmutableList<String> names, Codes.RowSink rowSink)
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceCodes.RowSink- Overrides:
acceptin classCodes.BaseRowSink
-
result
- Specified by:
resultin interfaceCodes.RowSink- Overrides:
resultin classCodes.BaseRowSink
-