Class HllCount.MergePartial
- Enclosing class:
HllCount
PTransform
s to merge HLL++ sketches into a new sketch.
Only sketches of the same type can be merged together. If incompatible sketches are provided, a runtime error will occur.
If sketches of different precision
s are merged, the merged sketch will get the
minimum precision encountered among all the input sketches.
An "empty sketch" represented by an byte array of length 0 is returned if the input
PCollection
is empty.
Corresponds to the HLL_COUNT.MERGE_PARTIAL(sketch)
function in BigQuery.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Combine.Globally
<byte @Nullable [], byte[]> globally()
Returns aCombine.Globally
PTransform
that takes an inputPCollection<byte[]>
of HLL++ sketches and returns aPCollection<byte[]>
of a new sketch merged from the input sketches.static <K> Combine.PerKey
<K, byte @Nullable [], byte[]> perKey()
Returns aCombine.PerKey
PTransform
that takes an inputPCollection<KV<K, byte[]>>
of (key, HLL++ sketch) pairs and returns aPCollection<KV<K, byte[]>>
of (key, new sketch merged from the input sketches under the key).
-
Method Details
-
globally
Returns aCombine.Globally
PTransform
that takes an inputPCollection<byte[]>
of HLL++ sketches and returns aPCollection<byte[]>
of a new sketch merged from the input sketches.Only sketches of the same type can be merged together. If incompatible sketches are provided, a runtime error will occur.
If sketches of different
precision
s are merged, the merged sketch will get the minimum precision encountered among all the input sketches.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, byte[]>>
of (key, HLL++ sketch) pairs and returns aPCollection<KV<K, byte[]>>
of (key, new sketch merged from the input sketches under the key).If sketches of different
precision
s are merged, the merged sketch will get the minimum precision encountered among all the input sketches.Only sketches of the same type can be merged together. If incompatible sketches are provided, a runtime error will occur.
-