use of io.prestosql.sql.tree.InListExpression in project hetu-core by openlookeng.
the class TestExpressionDomainTranslator method testInPredicateWithCasts.
@Test
public void testInPredicateWithCasts() {
assertPredicateTranslates(new InPredicate(toSymbolReference(C_BIGINT), new InListExpression(ImmutableList.of(cast(toExpression(1L, SMALLINT), BIGINT)))), withColumnDomains(ImmutableMap.of(C_BIGINT, Domain.singleValue(BIGINT, 1L))));
assertPredicateTranslates(new InPredicate(cast(C_SMALLINT, BIGINT), new InListExpression(ImmutableList.of(toExpression(1L, BIGINT)))), withColumnDomains(ImmutableMap.of(C_SMALLINT, Domain.singleValue(SMALLINT, 1L))));
assertUnsupportedPredicate(new InPredicate(cast(C_BIGINT, INTEGER), new InListExpression(ImmutableList.of(toExpression(1L, INTEGER)))));
}
use of io.prestosql.sql.tree.InListExpression in project hetu-core by openlookeng.
the class TestTupleDomainFilterUtils method in.
private InPredicate in(Expression expression, Type expressisonType, List<?> values) {
List<Type> types = nCopies(values.size(), expressisonType);
List<Expression> expressions = literalEncoder.toExpressions(values, types);
return new InPredicate(expression, new InListExpression(expressions));
}
Aggregations