Class SketchFrequencies.PerKeySketch<K,V>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,V>>,org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.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:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
- Enclosing class:
- SketchFrequencies
public abstract static class SketchFrequencies.PerKeySketch<K,V> extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,V>>,org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,SketchFrequencies.Sketch<V>>>>
Implementation ofSketchFrequencies.perKey().- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PerKeySketch()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,SketchFrequencies.Sketch<V>>>expand(org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,V>> input)SketchFrequencies.PerKeySketch<K,V>withConfidence(double conf)Sets theconfidencevalue, i.e.SketchFrequencies.PerKeySketch<K,V>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
-
-
-
-
Method Detail
-
withRelativeError
public SketchFrequencies.PerKeySketch<K,V> withRelativeError(double eps)
Sets the relative errorepsilon.Keep in mind that the lower the
epsilonvalue, the greater the width.- Parameters:
eps- the error relative to the total number of distinct elements
-
withConfidence
public SketchFrequencies.PerKeySketch<K,V> withConfidence(double conf)
Sets theconfidencevalue, 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
public org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,SketchFrequencies.Sketch<V>>> expand(org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,V>> input)
- Specified by:
expandin classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,V>>,org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<K,SketchFrequencies.Sketch<V>>>>
-
-