java.lang.Object
org.apache.beam.sdk.extensions.zetasketch.HllCount.Init.Builder<InputT>
- Type Parameters:
InputT- element type or value type inKVs of the inputPCollectionto thePTransformbeing built
- Enclosing class:
HllCount.Init
Builder for the
HllCount.Init combining PTransform.
Call withPrecision(int) to customize the precision parameter of the
sketch.
Call globally() or perKey() to finalize the PTransform.
-
Method Summary
Modifier and TypeMethodDescriptionCombine.Globally<InputT, byte[]> globally()Returns aCombine.GloballyPTransformthat takes an inputPCollection<InputT>and returns aPCollection<byte[]>which consists of the HLL++ sketch computed from the elements in the inputPCollection.<K> Combine.PerKey<K, InputT, byte[]> perKey()Returns aCombine.PerKeyPTransformthat takes an inputPCollection<KV<K, InputT>>and returns aPCollection<KV<K, byte[]>>which consists of the per-key HLL++ sketch computed from the values matching each key in the inputPCollection.withPrecision(int precision) Explicitly set theprecisionparameter used to compute HLL++ sketch.
-
Method Details
-
withPrecision
Explicitly set theprecisionparameter used to compute HLL++ sketch.Valid range is between
HllCount.MINIMUM_PRECISIONandHllCount.MAXIMUM_PRECISION. If this method is not called,HllCount.DEFAULT_PRECISIONwill be used. Sketches computed using differentprecisions cannot be merged together.- Parameters:
precision- theprecisionparameter used to compute HLL++ sketch
-
globally
Returns aCombine.GloballyPTransformthat takes an inputPCollection<InputT>and returns aPCollection<byte[]>which consists of the HLL++ sketch computed from the elements in the inputPCollection.Returns a singleton
PCollectionwith an "empty sketch" (byte array of length 0) if the inputPCollectionis empty. -
perKey
Returns aCombine.PerKeyPTransformthat takes an inputPCollection<KV<K, InputT>>and returns aPCollection<KV<K, byte[]>>which consists of the per-key HLL++ sketch computed from the values matching each key in the inputPCollection.
-