use of io.trino.sql.analyzer.TypeSignatureProvider in project trino by trinodb.
the class TestMinMaxByNAggregation method testMinVarcharArray.
@Test
public void testMinVarcharArray() {
List<TypeSignatureProvider> parameterTypes = fromTypes(new ArrayType(BIGINT), VARCHAR, BIGINT);
assertAggregation(FUNCTION_RESOLUTION, QualifiedName.of("min_by"), parameterTypes, ImmutableList.of(ImmutableList.of(2L, 3L), ImmutableList.of(4L, 5L)), 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 io.trino.sql.analyzer.TypeSignatureProvider in project trino by trinodb.
the class TestMinMaxByNAggregation method testMaxVarcharArray.
@Test
public void testMaxVarcharArray() {
List<TypeSignatureProvider> parameterTypes = fromTypes(new ArrayType(BIGINT), VARCHAR, BIGINT);
assertAggregation(FUNCTION_RESOLUTION, QualifiedName.of("max_by"), parameterTypes, 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 io.trino.sql.analyzer.TypeSignatureProvider in project trino by trinodb.
the class TestMinMaxByNAggregation method testMaxArrayVarchar.
@Test
public void testMaxArrayVarchar() {
List<TypeSignatureProvider> parameterTypes = fromTypes(VARCHAR, new ArrayType(BIGINT), BIGINT);
assertAggregation(FUNCTION_RESOLUTION, QualifiedName.of("max_by"), parameterTypes, 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 io.trino.sql.analyzer.TypeSignatureProvider in project trino by trinodb.
the class TestMinMaxByAggregation method testMinLongArraySlice.
@Test
public void testMinLongArraySlice() {
List<TypeSignatureProvider> parameterTypes = fromTypes(VARCHAR, new ArrayType(BIGINT));
assertAggregation(FUNCTION_RESOLUTION, QualifiedName.of("min_by"), parameterTypes, "c", createStringsBlock("a", "b", "c"), createArrayBigintBlock(asList(asList(3L, 4L), null, asList(2L, 2L))));
}
use of io.trino.sql.analyzer.TypeSignatureProvider in project trino by trinodb.
the class TestMinMaxByAggregation method testMaxBooleanLongArray.
@Test
public void testMaxBooleanLongArray() {
List<TypeSignatureProvider> parameterTypes = fromTypes(new ArrayType(BIGINT), BOOLEAN);
assertAggregation(FUNCTION_RESOLUTION, QualifiedName.of("max_by"), parameterTypes, asList(2L, 2L), createArrayBigintBlock(asList(asList(3L, 4L), null, asList(2L, 2L))), createBooleansBlock(false, false, true));
}
Aggregations