use of com.facebook.presto.metadata.Signature in project presto by prestodb.
the class TestArbitraryAggregation method testValidBoolean.
@Test
public void testValidBoolean() throws Exception {
InternalAggregationFunction booleanAgg = metadata.getFunctionRegistry().getAggregateFunctionImplementation(new Signature("arbitrary", AGGREGATE, parseTypeSignature(StandardTypes.BOOLEAN), parseTypeSignature(StandardTypes.BOOLEAN)));
assertAggregation(booleanAgg, true, createBooleansBlock(true, true));
}
use of com.facebook.presto.metadata.Signature in project presto by prestodb.
the class TestArbitraryAggregation method testValidDouble.
@Test
public void testValidDouble() throws Exception {
InternalAggregationFunction doubleAgg = metadata.getFunctionRegistry().getAggregateFunctionImplementation(new Signature("arbitrary", AGGREGATE, parseTypeSignature(StandardTypes.DOUBLE), parseTypeSignature(StandardTypes.DOUBLE)));
assertAggregation(doubleAgg, 2.0, createDoublesBlock(null, 2.0));
}
use of com.facebook.presto.metadata.Signature in project presto by prestodb.
the class TestArbitraryAggregation method testNullLong.
@Test
public void testNullLong() throws Exception {
InternalAggregationFunction longAgg = metadata.getFunctionRegistry().getAggregateFunctionImplementation(new Signature("arbitrary", AGGREGATE, parseTypeSignature(StandardTypes.BIGINT), parseTypeSignature(StandardTypes.BIGINT)));
assertAggregation(longAgg, null, createLongsBlock(null, null));
}
use of com.facebook.presto.metadata.Signature in project presto by prestodb.
the class TestArbitraryAggregation method testValidLong.
@Test
public void testValidLong() throws Exception {
InternalAggregationFunction longAgg = metadata.getFunctionRegistry().getAggregateFunctionImplementation(new Signature("arbitrary", AGGREGATE, parseTypeSignature(StandardTypes.BIGINT), parseTypeSignature(StandardTypes.BIGINT)));
assertAggregation(longAgg, 1L, createLongsBlock(1L, null));
}
use of com.facebook.presto.metadata.Signature in project presto by prestodb.
the class TestArrayAggregation method testNullPartial.
@Test
public void testNullPartial() throws Exception {
InternalAggregationFunction bigIntAgg = metadata.getFunctionRegistry().getAggregateFunctionImplementation(new Signature("array_agg", AGGREGATE, parseTypeSignature("array(bigint)"), parseTypeSignature(StandardTypes.BIGINT)));
assertAggregation(bigIntAgg, Arrays.asList(null, 2L, null, 3L, null), createLongsBlock(new Long[] { null, 2L, null, 3L, null }));
}
Aggregations