use of com.facebook.presto.cassandra.CassandraClusteringPredicatesExtractor in project presto by prestodb.
the class TestCassandraClusteringPredicatesExtractor method testBuildClusteringPredicate.
@Test
public void testBuildClusteringPredicate() {
TupleDomain<ColumnHandle> tupleDomain = TupleDomain.withColumnDomains(ImmutableMap.of(col1, Domain.singleValue(BIGINT, 23L), col2, Domain.singleValue(BIGINT, 34L), col4, Domain.singleValue(BIGINT, 26L)));
CassandraClusteringPredicatesExtractor predicatesExtractor = new CassandraClusteringPredicatesExtractor(cassandraTable.getClusteringKeyColumns(), tupleDomain);
List<String> predicate = predicatesExtractor.getClusteringKeyPredicates();
assertEquals(predicate.get(0), new StringBuilder("\"clusteringKey1\" = 34").toString());
}
use of com.facebook.presto.cassandra.CassandraClusteringPredicatesExtractor in project presto by prestodb.
the class TestCassandraClusteringPredicatesExtractor method testGetUnenforcedPredicates.
@Test
public void testGetUnenforcedPredicates() {
TupleDomain<ColumnHandle> tupleDomain = TupleDomain.withColumnDomains(ImmutableMap.of(col2, Domain.singleValue(BIGINT, 34L), col4, Domain.singleValue(BIGINT, 26L)));
CassandraClusteringPredicatesExtractor predicatesExtractor = new CassandraClusteringPredicatesExtractor(cassandraTable.getClusteringKeyColumns(), tupleDomain);
TupleDomain<ColumnHandle> unenforcedPredicates = TupleDomain.withColumnDomains(ImmutableMap.of(col4, Domain.singleValue(BIGINT, 26L)));
assertEquals(predicatesExtractor.getUnenforcedConstraints(), unenforcedPredicates);
}
Aggregations