@CombineFunction public static void combine(@AggregationState RegressionState state, @AggregationState RegressionState otherState) { mergeRegressionState(state, otherState); }
@OutputFunction(StandardTypes.BOOLEAN) public static void output(@AggregationState TriStateBooleanState state, BlockBuilder out) { TriStateBooleanState.write(BooleanType.BOOLEAN, state, out); } }
@CombineFunction public static void combine(@AggregationState NullableDoubleState combine1, @AggregationState NullableDoubleState combine2) { // noop this is only for annotation testing puproses }
@CombineFunction public static void combine(@AggregationState NullableDoubleState combine1, @AggregationState NullableDoubleState combine2) { // noop this is only for annotation testing puproses }
@CombineFunction public static void combine( @AggregationState NullableDoubleState combine1, @AggregationState NullableDoubleState combine2) { // noop this is only for annotation testing puproses }
@CombineFunction public static void combine( @AggregationState NullableDoubleState combine1, @AggregationState NullableDoubleState combine2) { // noop this is only for annotation testing puproses }
@CombineFunction public static void combine( @AggregationState NullableDoubleState combine1, @AggregationState NullableDoubleState combine2) { // noop this is only for annotation testing puproses }
@OutputFunction("varchar(z)") public static void output( @AggregationState SliceState state, BlockBuilder out) { // noop this is only for annotation testing puproses } }
@OutputFunction(StandardTypes.DOUBLE) public static void output(@AggregationState LongAndDoubleState state, BlockBuilder out) { long count = state.getLong(); if (count == 0) { out.appendNull(); } else { DOUBLE.writeDouble(out, Math.exp(state.getDouble() / count)); } } }
@InputFunction public static void add(@AggregationState DoubleHistogramAggregation.State state, @SqlType(StandardTypes.BIGINT) long buckets, @SqlType(StandardTypes.REAL) long value, @SqlType(StandardTypes.DOUBLE) double weight) { DoubleHistogramAggregation.add(state, buckets, intBitsToFloat((int) value), weight); }
@InputFunction public static void input(@AggregationState RegressionState state, @SqlType(StandardTypes.DOUBLE) double dependentValue, @SqlType(StandardTypes.DOUBLE) double independentValue) { updateRegressionState(state, independentValue, dependentValue); }
@InputFunction public static void add(@AggregationState State state, @SqlType(BIGINT) long buckets, @SqlType(DOUBLE) double value) { add(state, buckets, value, 1); }
@AggregationFunction("regr_slope") @OutputFunction(StandardTypes.REAL) public static void regrSlope(@AggregationState RegressionState state, BlockBuilder out) { double result = getRegressionSlope(state); if (Double.isFinite(result)) { REAL.writeLong(out, floatToRawIntBits((float) result)); } else { out.appendNull(); } }
private static void initializeDigest(@AggregationState DigestAndPercentileArrayState state) { QuantileDigest digest = state.getDigest(); if (digest == null) { digest = new QuantileDigest(0.01); state.setDigest(digest); state.addMemoryUsage(digest.estimatedInMemorySizeInBytes()); } } }
@InputFunction public static void weightedInput(@AggregationState DigestAndPercentileState state, @SqlType(StandardTypes.REAL) long value, @SqlType(StandardTypes.BIGINT) long weight, @SqlType(StandardTypes.DOUBLE) double percentile, @SqlType(StandardTypes.DOUBLE) double accuracy) { ApproximateLongPercentileAggregations.weightedInput(state, floatToSortableInt(intBitsToFloat((int) value)), weight, percentile, accuracy); }
@InputFunction public static void input( @AggregationState NullableDoubleState state, @SqlType(DOUBLE) double value) { // noop this is only for annotation testing puproses }
@OutputFunction(DOUBLE) public static void output( @OperatorDependency(operator = LESS_THAN, returnType = StandardTypes.BOOLEAN, argumentTypes = {DOUBLE, DOUBLE}) MethodHandle methodHandle, @AggregationState NullableDoubleState state, BlockBuilder out) { // noop this is only for annotation testing puproses }
@CombineFunction @TypeParameter("T1") @TypeParameter("T2") public static void combine( @TypeParameter("ROW(ARRAY(T1),ROW(ROW(T2)),CHAR)") Type type, @AggregationState NullableDoubleState state, @AggregationState NullableDoubleState otherState) { // noop this is only for annotation testing puproses }
@InputFunction public static void input(@AggregationState HyperLogLogState state, @SqlType(StandardTypes.DOUBLE) double value) { HyperLogLog hll = getOrCreateHyperLogLog(state); state.addMemoryUsage(-hll.estimatedInMemorySize()); hll.add(Double.doubleToLongBits(value)); state.addMemoryUsage(hll.estimatedInMemorySize()); }
@InputFunction public static void add(@AggregationState State state, @SqlType(BIGINT) long buckets, @SqlType(DOUBLE) double value, @SqlType(DOUBLE) double weight) { NumericHistogram histogram = state.get(); if (histogram == null) { checkCondition(buckets >= 2, INVALID_FUNCTION_ARGUMENT, "numeric_histogram bucket count must be greater than one"); histogram = new NumericHistogram(toIntExact(buckets), ENTRY_BUFFER_SIZE); state.set(histogram); } histogram.add(value, weight); }