Class ApproximateUnique.ApproximateUniqueCombineFn<T>

java.lang.Object
org.apache.beam.sdk.transforms.Combine.CombineFn<T,ApproximateUnique.ApproximateUniqueCombineFn.LargestUnique,Long>
org.apache.beam.sdk.transforms.ApproximateUnique.ApproximateUniqueCombineFn<T>
Type Parameters:
T - the type of the values being combined
All Implemented Interfaces:
Serializable, CombineFnBase.GlobalCombineFn<T,ApproximateUnique.ApproximateUniqueCombineFn.LargestUnique,Long>, HasDisplayData
Enclosing class:
ApproximateUnique

public static class ApproximateUnique.ApproximateUniqueCombineFn<T> extends Combine.CombineFn<T,ApproximateUnique.ApproximateUniqueCombineFn.LargestUnique,Long>
CombineFn that computes an estimate of the number of distinct values that were combined.

Hashes input elements, computes the top sampleSize hash values, and uses those to extrapolate the size of the entire set of hash values by assuming the rest of the hash values are as densely distributed as the top sampleSize.

Used to implement ApproximatUnique.globally(...) and ApproximatUnique.perKey(...).

See Also: