@Override public Object compute(Map<String, Object> combinedAggregators) { return zScoreTwoSamples( ((Number) successCount1.compute(combinedAggregators)).doubleValue(), ((Number) sample1Size.compute(combinedAggregators)).doubleValue(), ((Number) successCount2.compute(combinedAggregators)).doubleValue(), ((Number) sample2Size.compute(combinedAggregators)).doubleValue() ); }
@Override public Object compute(final Map<String, Object> combinedAggregators) { final DoublesSketch sketch = (DoublesSketch) field.compute(combinedAggregators); return sketch.getQuantile(fraction); }
@Override public Object compute(Map<String, Object> combinedAggregators) { double zScoreValue = ((Number) zScore.compute(combinedAggregators)) .doubleValue(); zScoreValue = Math.abs(zScoreValue); return 2 * (1 - cumulativeProbability(zScoreValue)); }
@Override public Object compute(final Map<String, Object> combinedAggregators) { final DoublesSketch sketch = (DoublesSketch) field.compute(combinedAggregators); return sketch.toString(); }
@Override public String compute(final Map<String, Object> combinedAggregators) { final HllSketch sketch = (HllSketch) field.compute(combinedAggregators); return sketch.toString(); }
@Override public Object compute(final Map<String, Object> combinedAggregators) { Object[] sketches = new Object[fields.size()]; for (int i = 0; i < sketches.length; i++) { sketches[i] = fields.get(i).compute(combinedAggregators); } return SketchHolder.sketchSetOperation(func, maxSketchSize, sketches); }
@Override public Object compute(final Map<String, Object> combinedAggregators) { final DoublesSketch sketch = (DoublesSketch) field.compute(combinedAggregators); return sketch.getQuantiles(fractions); }
@Override public Object compute(Map<String, Object> values) { Iterator<PostAggregator> fieldsIter = fields.iterator(); Long retVal = NullHandling.replaceWithDefault() ? Long.MAX_VALUE : null; while (fieldsIter.hasNext()) { Number nextVal = ((Number) fieldsIter.next().compute(values)); // Ignore NULL values and return the greatest out of non-null values. if (nextVal != null && (retVal == null || COMPARATOR.compare(nextVal, retVal) < 0)) { if (nextVal instanceof Long) { retVal = (Long) nextVal; } else { retVal = nextVal.longValue(); } } } return retVal; }
@Override public Object compute(Map<String, Object> combinedAggregators) { SketchHolder holder = (SketchHolder) field.compute(combinedAggregators); if (errorBoundsStdDev != null) { return holder.getEstimateWithErrorBounds(errorBoundsStdDev); } else { return holder.getEstimate(); } }
@Override public Integer compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); return sketch.getRetainedEntries(); }
@Override public String compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); return sketch.toString(); }
@Override public ArrayOfDoublesSketch compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch[] sketches = new ArrayOfDoublesSketch[getFields().size()]; for (int i = 0; i < sketches.length; i++) { sketches[i] = (ArrayOfDoublesSketch) getFields().get(i).compute(combinedAggregators); } return operation.apply(nominalEntries, numberOfValues, sketches); }
@Override public Double compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); return sketch.getEstimate(); }
@Override public Object compute(final Map<String, Object> combinedAggregators) { final DoublesSketch sketch = (DoublesSketch) field.compute(combinedAggregators); final double[] histogram = sketch.getPMF(splitPoints); for (int i = 0; i < histogram.length; i++) { histogram[i] *= sketch.getN(); } return histogram; }
@Override public HllSketch compute(final Map<String, Object> combinedAggregators) { final Union union = new Union(lgK); for (final PostAggregator field : fields) { final HllSketch sketch = (HllSketch) field.compute(combinedAggregators); union.update(sketch); } return union.getResult(tgtHllType); }
@Override public double[] compute(final Map<String, Object> combinedAggregators) { final HllSketch sketch = (HllSketch) field.compute(combinedAggregators); return new double[] {sketch.getEstimate(), sketch.getLowerBound(numStdDevs), sketch.getUpperBound(numStdDevs)}; }
@Override public double[] compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); return new double[] {sketch.getEstimate(), sketch.getLowerBound(numStdDevs), sketch.getUpperBound(numStdDevs)}; }
@Override public DoublesSketch compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); final UpdateDoublesSketch qs = DoublesSketch.builder().setK(k).build(); final ArrayOfDoublesSketchIterator it = sketch.iterator(); while (it.next()) { qs.update(it.getValues()[column - 1]); // convert 1-based column number to zero-based index } return qs; }
@Override public double[] compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); final SummaryStatistics[] stats = new SummaryStatistics[sketch.getNumValues()]; Arrays.setAll(stats, i -> new SummaryStatistics()); final ArrayOfDoublesSketchIterator it = sketch.iterator(); while (it.next()) { final double[] values = it.getValues(); for (int i = 0; i < values.length; i++) { stats[i].addValue(values[i]); } } final double[] variances = new double[sketch.getNumValues()]; Arrays.setAll(variances, i -> stats[i].getVariance()); return variances; }
@Override public double[] compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); final SummaryStatistics[] stats = new SummaryStatistics[sketch.getNumValues()]; Arrays.setAll(stats, i -> new SummaryStatistics()); final ArrayOfDoublesSketchIterator it = sketch.iterator(); while (it.next()) { final double[] values = it.getValues(); for (int i = 0; i < values.length; i++) { stats[i].addValue(values[i]); } } final double[] means = new double[sketch.getNumValues()]; Arrays.setAll(means, i -> stats[i].getMean()); return means; }