public static void inputDouble(QuantileDigestState state, double value, long weight, double accuracy) { inputBigint(state, doubleToSortableLong(value), weight, accuracy); }
public static ParameterMetadata fromSqlType(Type sqlType, boolean isBlock, boolean isNullable, String methodName) { return new ParameterMetadata(inputChannelParameterType(isNullable, isBlock, methodName), sqlType); }
@Override public Type getFinalType() { return accumulator.getFinalType(); }
@Test(expectedExceptions = PrestoException.class) public void testBadNumberOfBuckets() { Accumulator singleStep = factory.createAccumulator(); singleStep.addInput(makeInput(0)); getFinalBlock(singleStep); }
@Test(expectedExceptions = PrestoException.class) public void testBadNumberOfBuckets() { Accumulator singleStep = factory.createAccumulator(); singleStep.addInput(makeInput(0)); getFinalBlock(singleStep); }
private long estimateGroupByCount(List<?> values, double maxStandardError) { Object result = AggregationTestUtils.groupedAggregation(getAggregationFunction(), createPage(values, maxStandardError)); return (long) result; }
private long estimateCount(List<?> values, double maxStandardError) { Object result = AggregationTestUtils.aggregation(getAggregationFunction(), createPage(values, maxStandardError)); return (long) result; }
private long estimateCountPartial(List<Object> values, double maxStandardError) { Object result = AggregationTestUtils.partialAggregation(getAggregationFunction(), createPage(values, maxStandardError)); return (long) result; }
protected void testAggregation(Object expectedValue, Block... blocks) { assertAggregation(getFunction(), expectedValue, blocks); } }
@Override public long getEstimatedSize() { if (histogram == null) { return 0; } return histogram.estimatedInMemorySize(); } }
public MinMaxByNStateSerializer(BlockComparator blockComparator, Type keyType, Type valueType) { this.blockComparator = blockComparator; this.keyType = keyType; this.valueType = valueType; this.serializedType = TypedKeyValueHeap.getSerializedType(keyType, valueType); }
public static int[] offsetArgs(InternalAggregationFunction function, int offset) { int[] args = createArgs(function); for (int i = 0; i < args.length; i++) { args[i] += offset; } return args; }
@Test(expectedExceptions = PrestoException.class) public void testBadNumberOfBuckets() { Accumulator singleStep = factory.createAccumulator(); singleStep.addInput(makeInput(0)); getFinalBlock(singleStep); }
@Test(expectedExceptions = PrestoException.class) public void testBadNumberOfBuckets() { Accumulator singleStep = factory.createAccumulator(); singleStep.addInput(makeInput(0)); getFinalBlock(singleStep); }
private long estimateGroupByCount(List<Object> values, double maxStandardError) { Object result = AggregationTestUtils.groupedAggregation(getAggregationFunction(), createPage(values, maxStandardError)); return (long) result; }
private long estimateCount(List<Object> values, double maxStandardError) { Object result = AggregationTestUtils.aggregation(getAggregationFunction(), createPage(values, maxStandardError)); return (long) result; }
private long estimateCountPartial(List<?> values, double maxStandardError) { Object result = AggregationTestUtils.partialAggregation(getAggregationFunction(), createPage(values, maxStandardError)); return (long) result; }
protected void testAggregation(Object expectedValue, Block... blocks) { assertAggregation(getFunction(), expectedValue, blocks); } }
public static void inputDouble(QuantileDigestState state, double value, long weight, double accuracy) { inputBigint(state, doubleToSortableLong(value), weight, accuracy); }
public static ParameterMetadata fromSqlType(Type sqlType, boolean isBlock, boolean isNullable, String methodName) { return new ParameterMetadata(inputChannelParameterType(isNullable, isBlock, methodName), sqlType); }