use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByAggregation method testMinDoubleLongArray.
@Test
public void testMinDoubleLongArray() {
InternalAggregationFunction function = getMinByAggregation(new ArrayType(BIGINT), DOUBLE);
assertAggregation(function, asList(3L, 4L), createArrayBigintBlock(asList(asList(3L, 4L), null, asList(2L, 2L))), createDoublesBlock(1.0, 2.0, 3.0));
assertAggregation(function, null, createArrayBigintBlock(asList(null, null, asList(2L, 2L))), createDoublesBlock(0.0, 1.0, 2.0));
}
use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByAggregation method testMinLongDecimalDecimal.
@Test
public void testMinLongDecimalDecimal() {
Type decimalType = createDecimalType(19, 1);
InternalAggregationFunction function = getMinByAggregation(decimalType, decimalType);
assertAggregation(function, SqlDecimal.of("2.2"), createLongDecimalsBlock("1.1", "2.2", "3.3"), createLongDecimalsBlock("1.2", "1.0", "2.0"));
}
use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByAggregation method testMaxLongVarchar.
@Test
public void testMaxLongVarchar() {
InternalAggregationFunction function = getMaxByAggregation(VARCHAR, BIGINT);
assertAggregation(function, "c", createStringsBlock("a", "b", "c"), createLongsBlock(1, 2, 3));
}
use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByAggregation method testMaxBooleanLongArray.
@Test
public void testMaxBooleanLongArray() {
InternalAggregationFunction function = getMaxByAggregation(new ArrayType(BIGINT), BOOLEAN);
assertAggregation(function, asList(2L, 2L), createArrayBigintBlock(asList(asList(3L, 4L), null, asList(2L, 2L))), createBooleansBlock(false, false, true));
}
use of com.facebook.presto.operator.aggregation.InternalAggregationFunction in project presto by prestodb.
the class TestMinMaxByAggregation method testMinUnknown.
@Test
public void testMinUnknown() {
InternalAggregationFunction unknownKey = getMinByAggregation(UNKNOWN, DOUBLE);
assertAggregation(unknownKey, null, createBooleansBlock(null, null), createDoublesBlock(1.0, 2.0));
InternalAggregationFunction unknownValue = getMinByAggregation(DOUBLE, UNKNOWN);
assertAggregation(unknownValue, null, createDoublesBlock(1.0, 2.0), createBooleansBlock(null, null));
}
Aggregations