Package net.hydromatic.morel.eval
Class Codes.IntersectDistinctRowSink
java.lang.Object
net.hydromatic.morel.eval.Codes.BaseRowSink
net.hydromatic.morel.eval.Codes.SetRowSink
net.hydromatic.morel.eval.Codes.IntersectDistinctRowSink
- All Implemented Interfaces:
Codes.RowSink,Describable
- Enclosing class:
Codes
Implementation of
Codes.RowSink for a distinct intersect step.
The algorithm is as follows:
- Populate the map with (k, 0) for each key k from input 0;
- Read input 1, and for each key increments the count.
- If there is another input, first remove each key with count zero, and sets other keys' count to zero. Then repeat from step 1.
- Output all keys that have count greater than 0 from the last pass.
-
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
ConstructorsConstructorDescriptionIntersectDistinctRowSink(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
-
IntersectDistinctRowSink
IntersectDistinctRowSink(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
-