Search in sources :

Example 1 with DictionaryDescriptor

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))));
}
Also used : DictionaryDescriptor(com.facebook.presto.parquet.predicate.DictionaryDescriptor) ColumnDescriptor(org.apache.parquet.column.ColumnDescriptor) TupleDomainParquetPredicate(com.facebook.presto.parquet.predicate.TupleDomainParquetPredicate) PrimitiveType(org.apache.parquet.schema.PrimitiveType) Test(org.testng.annotations.Test)

Aggregations

DictionaryDescriptor (com.facebook.presto.parquet.predicate.DictionaryDescriptor)1 TupleDomainParquetPredicate (com.facebook.presto.parquet.predicate.TupleDomainParquetPredicate)1 ColumnDescriptor (org.apache.parquet.column.ColumnDescriptor)1 PrimitiveType (org.apache.parquet.schema.PrimitiveType)1 Test (org.testng.annotations.Test)1