Search in sources :

Example 6 with DoublesUnion

use of org.apache.datasketches.quantiles.DoublesUnion in project druid by druid-io.

the class DoublesSketchMergeVectorAggregator method aggregate.

@Override
public void aggregate(final ByteBuffer buf, final int position, final int startRow, final int endRow) {
    final Object[] vector = selector.getObjectVector();
    final DoublesUnion union = helper.getSketchAtPosition(buf, position);
    DoublesSketches.handleMaxStreamLengthLimit(() -> {
        for (int i = startRow; i < endRow; i++) {
            final DoublesSketch sketch = (DoublesSketch) vector[i];
            if (sketch != null) {
                union.update(sketch);
            }
        }
    });
}
Also used : DoublesSketch(org.apache.datasketches.quantiles.DoublesSketch) DoublesUnion(org.apache.datasketches.quantiles.DoublesUnion)

Aggregations

DoublesUnion (org.apache.datasketches.quantiles.DoublesUnion)6 DoublesSketch (org.apache.datasketches.quantiles.DoublesSketch)3 WritableMemory (org.apache.datasketches.memory.WritableMemory)2 ObjectAggregateCombiner (org.apache.druid.query.aggregation.ObjectAggregateCombiner)1 BaseDoubleColumnValueSelector (org.apache.druid.segment.BaseDoubleColumnValueSelector)1 ColumnValueSelector (org.apache.druid.segment.ColumnValueSelector)1 NilColumnValueSelector (org.apache.druid.segment.NilColumnValueSelector)1