use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByAggregation method testMinLongLongArray.
@Test
public void testMinLongLongArray() {
InternalAggregationFunction function = getMinByAggregation(new ArrayType(BIGINT), BIGINT);
assertAggregation(function, ImmutableList.of(8L, 9L), createArrayBigintBlock(ImmutableList.of(ImmutableList.of(8L, 9L), ImmutableList.of(1L, 2L), ImmutableList.of(6L, 7L), ImmutableList.of(2L, 3L))), createLongsBlock(1L, 2L, 2L, 3L));
assertAggregation(function, ImmutableList.of(2L), createArrayBigintBlock(ImmutableList.of(ImmutableList.of(8L, 9L), ImmutableList.of(6L, 7L), ImmutableList.of(2L, 3L), ImmutableList.of(2L))), createLongsBlock(0L, 1L, 2L, -1L));
}
use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByAggregation method testMaxLongArrayLongArray.
@Test
public void testMaxLongArrayLongArray() {
InternalAggregationFunction function = getMaxByAggregation(new ArrayType(BIGINT), new ArrayType(BIGINT));
assertAggregation(function, asList(3L, 3L), createArrayBigintBlock(asList(asList(3L, 3L), null, asList(1L, 2L))), createArrayBigintBlock(asList(asList(3L, 4L), null, asList(2L, 2L))));
}
use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByAggregation method testMinSliceLongArray.
@Test
public void testMinSliceLongArray() {
InternalAggregationFunction function = getMinByAggregation(new ArrayType(BIGINT), VARCHAR);
assertAggregation(function, asList(3L, 4L), createArrayBigintBlock(asList(asList(3L, 4L), null, asList(2L, 2L))), createStringsBlock("a", "b", "c"));
assertAggregation(function, null, createArrayBigintBlock(asList(null, null, asList(2L, 2L))), createStringsBlock("a", "b", "c"));
}
use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByAggregation method testMinUnknownLongArray.
@Test
public void testMinUnknownLongArray() {
InternalAggregationFunction function = getMinByAggregation(new ArrayType(BIGINT), UNKNOWN);
assertAggregation(function, null, createArrayBigintBlock(asList(asList(3L, 3L), null, asList(1L, 2L))), createArrayBigintBlock(asList(null, null, null)));
}
use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByAggregation method testMaxBooleanVarchar.
@Test
public void testMaxBooleanVarchar() {
InternalAggregationFunction function = getMaxByAggregation(VARCHAR, BOOLEAN);
assertAggregation(function, "c", createStringsBlock("a", "b", "c"), createBooleansBlock(false, false, true));
}
Aggregations