Search in sources :

Example 1 with ColumnReference

use of com.facebook.presto.hive.parquet.predicate.TupleDomainParquetPredicate.ColumnReference in project presto by prestodb.

the class ParquetPredicateUtils method buildParquetPredicate.

public static ParquetPredicate buildParquetPredicate(List<HiveColumnHandle> columns, TupleDomain<HiveColumnHandle> effectivePredicate, MessageType fileSchema, TypeManager typeManager) {
    ImmutableList.Builder<ColumnReference<HiveColumnHandle>> columnReferences = ImmutableList.builder();
    for (HiveColumnHandle column : columns) {
        if (!column.isPartitionKey()) {
            int parquetFieldIndex = lookupParquetColumn(column, fileSchema);
            Type type = typeManager.getType(column.getTypeSignature());
            columnReferences.add(new ColumnReference<>(column, parquetFieldIndex, type));
        }
    }
    return new TupleDomainParquetPredicate<>(effectivePredicate, columnReferences.build());
}
Also used : PageType(parquet.format.PageType) Type(com.facebook.presto.spi.type.Type) MessageType(parquet.schema.MessageType) ImmutableList(com.google.common.collect.ImmutableList) HiveColumnHandle(com.facebook.presto.hive.HiveColumnHandle) ColumnReference(com.facebook.presto.hive.parquet.predicate.TupleDomainParquetPredicate.ColumnReference)

Aggregations

HiveColumnHandle (com.facebook.presto.hive.HiveColumnHandle)1 ColumnReference (com.facebook.presto.hive.parquet.predicate.TupleDomainParquetPredicate.ColumnReference)1 Type (com.facebook.presto.spi.type.Type)1 ImmutableList (com.google.common.collect.ImmutableList)1 PageType (parquet.format.PageType)1 MessageType (parquet.schema.MessageType)1