use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByNAggregation method testMinDoubleVarchar.
@Test
public void testMinDoubleVarchar() {
InternalAggregationFunction function = getMinByAggregation(VARCHAR, DOUBLE, BIGINT);
assertAggregation(function, ImmutableList.of("z", "a"), createStringsBlock("z", "a", "x", "b"), createDoublesBlock(1.0, 2.0, 2.0, 3.0), createRLEBlock(2L, 4));
assertAggregation(function, ImmutableList.of("a", "zz"), createStringsBlock("zz", "hi", "bb", "a"), createDoublesBlock(0.0, 1.0, 2.0, -1.0), createRLEBlock(2L, 4));
assertAggregation(function, ImmutableList.of("a", "zz"), createStringsBlock("zz", "hi", null, "a"), createDoublesBlock(0.0, 1.0, null, -1.0), createRLEBlock(2L, 4));
}
use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByNAggregation method testMaxArrayVarchar.
@Test
public void testMaxArrayVarchar() {
InternalAggregationFunction function = getMaxByAggregation(VARCHAR, new ArrayType(BIGINT), BIGINT);
assertAggregation(function, ImmutableList.of("a", "z", "x"), createStringsBlock("z", "a", "x", "b"), createArrayBigintBlock(ImmutableList.of(ImmutableList.of(1L, 2L), ImmutableList.of(2L, 3L), ImmutableList.of(0L, 3L), ImmutableList.of(0L, 2L))), createRLEBlock(3L, 4));
}
use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByNAggregation method testMaxVarcharArray.
@Test
public void testMaxVarcharArray() {
InternalAggregationFunction function = getMaxByAggregation(new ArrayType(BIGINT), VARCHAR, BIGINT);
assertAggregation(function, ImmutableList.of(ImmutableList.of(1L, 2L), ImmutableList.of(3L, 4L)), createArrayBigintBlock(ImmutableList.of(ImmutableList.of(1L, 2L), ImmutableList.of(2L, 3L), ImmutableList.of(3L, 4L), ImmutableList.of(4L, 5L))), createStringsBlock("z", "a", "x", "b"), createRLEBlock(2L, 4));
}
use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByNAggregation method testMaxVarcharDouble.
@Test
public void testMaxVarcharDouble() {
InternalAggregationFunction function = getMaxByAggregation(DOUBLE, VARCHAR, BIGINT);
assertAggregation(function, ImmutableList.of(1.0, 2.0), createDoublesBlock(1.0, 2.0, null), createStringsBlock("z", "a", null), createRLEBlock(2L, 3));
assertAggregation(function, ImmutableList.of(0.0, 1.0), createDoublesBlock(0.0, 1.0, 2.0, -1.0), createStringsBlock("zz", "hi", "bb", "a"), createRLEBlock(2L, 4));
assertAggregation(function, ImmutableList.of(0.0, 1.0), createDoublesBlock(0.0, 1.0, null, -1.0), createStringsBlock("zz", "hi", null, "a"), createRLEBlock(2L, 4));
}
Aggregations