Search in sources :

Example 1 with BigintValuesUsingBitmask

use of com.facebook.presto.common.predicate.TupleDomainFilter.BigintValuesUsingBitmask in project presto by prestodb.

the class OrcSelectiveRecordReader method scoreFilter.

private static int scoreFilter(Map<Subfield, TupleDomainFilter> filters) {
    checkArgument(!filters.isEmpty());
    if (filters.size() > 1) {
        // Complex type column. Complex types are expensive!
        return 1000;
    }
    Map.Entry<Subfield, TupleDomainFilter> filterEntry = Iterables.getOnlyElement(filters.entrySet());
    if (!filterEntry.getKey().getPath().isEmpty()) {
        // Complex type column. Complex types are expensive!
        return 1000;
    }
    TupleDomainFilter filter = filterEntry.getValue();
    if (filter instanceof BigintRange) {
        if (((BigintRange) filter).isSingleValue()) {
            // Integer equality. Generally cheap.
            return 10;
        }
        return 50;
    }
    if (filter instanceof BigintValuesUsingHashTable || filter instanceof BigintValuesUsingBitmask || filter instanceof BigintMultiRange) {
        return 50;
    }
    return 100;
}
Also used : BigintValuesUsingHashTable(com.facebook.presto.common.predicate.TupleDomainFilter.BigintValuesUsingHashTable) BigintRange(com.facebook.presto.common.predicate.TupleDomainFilter.BigintRange) BigintMultiRange(com.facebook.presto.common.predicate.TupleDomainFilter.BigintMultiRange) BigintValuesUsingBitmask(com.facebook.presto.common.predicate.TupleDomainFilter.BigintValuesUsingBitmask) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) HashMap(java.util.HashMap) Subfield(com.facebook.presto.common.Subfield) TupleDomainFilter(com.facebook.presto.common.predicate.TupleDomainFilter)

Aggregations

Subfield (com.facebook.presto.common.Subfield)1 TupleDomainFilter (com.facebook.presto.common.predicate.TupleDomainFilter)1 BigintMultiRange (com.facebook.presto.common.predicate.TupleDomainFilter.BigintMultiRange)1 BigintRange (com.facebook.presto.common.predicate.TupleDomainFilter.BigintRange)1 BigintValuesUsingBitmask (com.facebook.presto.common.predicate.TupleDomainFilter.BigintValuesUsingBitmask)1 BigintValuesUsingHashTable (com.facebook.presto.common.predicate.TupleDomainFilter.BigintValuesUsingHashTable)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 ImmutableMap.toImmutableMap (com.google.common.collect.ImmutableMap.toImmutableMap)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1