Class SketchFrequencies.PerKeySketch<K,V>
java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<KV<K,V>>,PCollection<KV<K,SketchFrequencies.Sketch<V>>>>
org.apache.beam.sdk.extensions.sketching.SketchFrequencies.PerKeySketch<K,V>
- Type Parameters:
K
- type of the keys mapping the elementsV
- type of the values being combined per key
- All Implemented Interfaces:
Serializable
,HasDisplayData
- Enclosing class:
SketchFrequencies
public abstract static class SketchFrequencies.PerKeySketch<K,V>
extends PTransform<PCollection<KV<K,V>>,PCollection<KV<K,SketchFrequencies.Sketch<V>>>>
Implementation of
SketchFrequencies.perKey()
.- See Also:
-
Field Summary
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexpand
(PCollection<KV<K, V>> input) Override this method to specify how thisPTransform
should be expanded on the givenInputT
.withConfidence
(double conf) Sets theconfidence
value, i.e.withRelativeError
(double eps) Sets the relative errorepsilon
.Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
Constructor Details
-
PerKeySketch
public PerKeySketch()
-
-
Method Details
-
withRelativeError
Sets the relative errorepsilon
.Keep in mind that the lower the
epsilon
value, the greater the width.- Parameters:
eps
- the error relative to the total number of distinct elements
-
withConfidence
Sets theconfidence
value, i.e. the probability that the relative error is lower or equal toepsilon
.Keep in mind that the greater the confidence, the greater the depth.
- Parameters:
conf
- the confidence in the result to not exceed the relative error
-
expand
Description copied from class:PTransform
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to theInputT
using theapply
method.Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
- Specified by:
expand
in classPTransform<PCollection<KV<K,
V>>, PCollection<KV<K, SketchFrequencies.Sketch<V>>>>
-