Search in sources :

Example 16 with RichColumnDescriptor

use of com.facebook.presto.parquet.RichColumnDescriptor in project presto by prestodb.

the class TestParquetPredicateUtils method testParquetTupleDomainStruct.

@Test
public void testParquetTupleDomainStruct() {
    HiveColumnHandle columnHandle = new HiveColumnHandle("my_struct", HiveType.valueOf("struct<a:int,b:int>"), parseTypeSignature(StandardTypes.ROW), 0, REGULAR, Optional.empty(), Optional.empty());
    RowType.Field rowField = new RowType.Field(Optional.of("my_struct"), INTEGER);
    RowType rowType = RowType.from(ImmutableList.of(rowField));
    TupleDomain<HiveColumnHandle> domain = withColumnDomains(ImmutableMap.of(columnHandle, Domain.notNull(rowType)));
    MessageType fileSchema = new MessageType("hive_schema", new GroupType(OPTIONAL, "my_struct", new PrimitiveType(OPTIONAL, INT32, "a"), new PrimitiveType(OPTIONAL, INT32, "b")));
    Map<List<String>, RichColumnDescriptor> descriptorsByPath = getDescriptors(fileSchema, fileSchema);
    TupleDomain<ColumnDescriptor> tupleDomain = getParquetTupleDomain(descriptorsByPath, domain);
    assertTrue(tupleDomain.getDomains().get().isEmpty());
}
Also used : RichColumnDescriptor(com.facebook.presto.parquet.RichColumnDescriptor) RichColumnDescriptor(com.facebook.presto.parquet.RichColumnDescriptor) ColumnDescriptor(org.apache.parquet.column.ColumnDescriptor) RowType(com.facebook.presto.common.type.RowType) GroupType(org.apache.parquet.schema.GroupType) PrimitiveType(org.apache.parquet.schema.PrimitiveType) ImmutableList(com.google.common.collect.ImmutableList) List(java.util.List) HiveColumnHandle(com.facebook.presto.hive.HiveColumnHandle) MessageType(org.apache.parquet.schema.MessageType) Test(org.testng.annotations.Test)

Aggregations

RichColumnDescriptor (com.facebook.presto.parquet.RichColumnDescriptor)16 ColumnDescriptor (org.apache.parquet.column.ColumnDescriptor)12 Domain (com.facebook.presto.common.predicate.Domain)9 TupleDomain (com.facebook.presto.common.predicate.TupleDomain)9 ImmutableList (com.google.common.collect.ImmutableList)9 HiveColumnHandle (com.facebook.presto.hive.HiveColumnHandle)8 List (java.util.List)8 MessageType (org.apache.parquet.schema.MessageType)8 ImmutableMap (com.google.common.collect.ImmutableMap)6 Subfield (com.facebook.presto.common.Subfield)4 Type (com.facebook.presto.common.type.Type)4 Field (com.facebook.presto.parquet.Field)4 ParquetTypeUtils.columnPathFromSubfield (com.facebook.presto.parquet.ParquetTypeUtils.columnPathFromSubfield)4 GroupType (org.apache.parquet.schema.GroupType)4 TypeManager (com.facebook.presto.common.type.TypeManager)3 PrimitiveType (org.apache.parquet.schema.PrimitiveType)3 Test (org.testng.annotations.Test)3 RuntimeStats (com.facebook.presto.common.RuntimeStats)2 MapType (com.facebook.presto.common.type.MapType)2 RowType (com.facebook.presto.common.type.RowType)2