use of io.trino.sql.analyzer.TypeSignatureProvider in project trino by trinodb.
the class TestMinMaxByAggregation method testMaxLongArrayLong.
@Test
public void testMaxLongArrayLong() {
List<TypeSignatureProvider> parameterTypes = fromTypes(BIGINT, new ArrayType(BIGINT));
assertAggregation(FUNCTION_RESOLUTION, QualifiedName.of("max_by"), parameterTypes, 1L, createLongsBlock(1L, 2L, 2L, 3L), createArrayBigintBlock(ImmutableList.of(ImmutableList.of(8L, 9L), ImmutableList.of(1L, 2L), ImmutableList.of(6L, 7L), ImmutableList.of(1L, 1L))));
assertAggregation(FUNCTION_RESOLUTION, QualifiedName.of("max_by"), parameterTypes, 2L, createLongsBlock(0L, 1L, 2L, -1L), createArrayBigintBlock(ImmutableList.of(ImmutableList.of(-8L, 9L), ImmutableList.of(-6L, 7L), ImmutableList.of(-1L, -3L), ImmutableList.of(-1L))));
}
use of io.trino.sql.analyzer.TypeSignatureProvider in project trino by trinodb.
the class TestMinMaxByAggregation method testMinLongLongArray.
@Test
public void testMinLongLongArray() {
List<TypeSignatureProvider> parameterTypes = fromTypes(new ArrayType(BIGINT), BIGINT);
assertAggregation(FUNCTION_RESOLUTION, QualifiedName.of("min_by"), parameterTypes, 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_RESOLUTION, QualifiedName.of("min_by"), parameterTypes, 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));
}
Aggregations