java.lang.Object
org.apache.beam.sdk.extensions.zetasketch.HllCount.Init.Builder<InputT>
- Type Parameters:
InputT
- element type or value type inKV
s of the inputPCollection
to thePTransform
being 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.Globally
PTransform
that 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.PerKey
PTransform
that 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 theprecision
parameter used to compute HLL++ sketch.
-
Method Details
-
withPrecision
Explicitly set theprecision
parameter used to compute HLL++ sketch.Valid range is between
HllCount.MINIMUM_PRECISION
andHllCount.MAXIMUM_PRECISION
. If this method is not called,HllCount.DEFAULT_PRECISION
will be used. Sketches computed using differentprecision
s cannot be merged together.- Parameters:
precision
- theprecision
parameter used to compute HLL++ sketch
-
globally
Returns aCombine.Globally
PTransform
that takes an inputPCollection<InputT>
and returns aPCollection<byte[]>
which consists of the HLL++ sketch computed from the elements in the inputPCollection
.Returns a singleton
PCollection
with an "empty sketch" (byte array of length 0) if the inputPCollection
is empty. -
perKey
Returns aCombine.PerKey
PTransform
that 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
.
-