public class TupleSketchingStrategy extends SketchingStrategy<S>
Strategy
implements a Tuple Sketch based approach to doing a group by. In particular, it
provides a uniform sample of the groups if the number of unique groups exceed the Sketch size. Metrics like
sum and count when summed across the uniform sample and divided the sketch theta gives an approximate estimate
of the total sum and count across all the groups.fields, metadataKeys, separator, sketch
Constructor and Description |
---|
TupleSketchingStrategy(GroupBy aggregation,
BulletConfig config)
Constructor that requires an
Aggregation and a BulletConfig configuration. |
Modifier and Type | Method and Description |
---|---|
void |
consume(com.yahoo.bullet.record.BulletRecord data)
Consumes a single
BulletRecord into this Monoid. |
static com.yahoo.sketches.ResizeFactor |
getResizeFactor(int factor)
Converts a integer representing the resizing for Sketches into a
ResizeFactor . |
combine, getData, getMetadata, getRecords, getResult, reset
public TupleSketchingStrategy(GroupBy aggregation, BulletConfig config)
Aggregation
and a BulletConfig
configuration.aggregation
- An Aggregation
with valid fields and attributes for this aggregation type.config
- The config that has relevant configs for this strategy.public void consume(com.yahoo.bullet.record.BulletRecord data)
Monoidal
BulletRecord
into this Monoid.data
- The BulletRecord
to consume.public static com.yahoo.sketches.ResizeFactor getResizeFactor(int factor)
ResizeFactor
.factor
- An int representing the scaling when the Sketch reaches its threshold. Supports 1, 2, 4 and 8.ResizeFactor
represented by the integer or ResizeFactor.X8
otherwise.Copyright © 2021. All rights reserved.