use of com.facebook.presto.parquet.predicate.DictionaryDescriptor in project presto by prestodb.
the class TestTupleDomainParquetPredicate method testVarcharMatchesWithDictionaryDescriptor.
@Test
public void testVarcharMatchesWithDictionaryDescriptor() {
ColumnDescriptor columnDescriptor = new ColumnDescriptor(new String[] { "path" }, new PrimitiveType(OPTIONAL, BINARY, 0, ""), 0, 0);
RichColumnDescriptor column = new RichColumnDescriptor(columnDescriptor, new PrimitiveType(OPTIONAL, BINARY, "Test column"));
TupleDomain<ColumnDescriptor> effectivePredicate = getEffectivePredicate(column, createVarcharType(255), EMPTY_SLICE);
TupleDomainParquetPredicate parquetPredicate = new TupleDomainParquetPredicate(effectivePredicate, singletonList(column));
DictionaryPage page = new DictionaryPage(Slices.wrappedBuffer(new byte[] { 0, 0, 0, 0 }), 1, PLAIN_DICTIONARY);
assertTrue(parquetPredicate.matches(new DictionaryDescriptor(column, Optional.of(page))));
}
Aggregations