Search in sources :

Example 1 with KeyWrapper

use of org.apache.hadoop.hive.ql.exec.KeyWrapper in project hive by apache.

the class VectorTopNKeyOperator method checkTopNFilterEfficiency.

public static void checkTopNFilterEfficiency(Map<KeyWrapper, TopNKeyFilter> filters, Set<KeyWrapper> disabledPartitions, float efficiencyThreshold, Logger log, long checkEfficiencyNumRows) {
    Iterator<Map.Entry<KeyWrapper, TopNKeyFilter>> iterator = filters.entrySet().iterator();
    while (iterator.hasNext()) {
        Map.Entry<KeyWrapper, TopNKeyFilter> each = iterator.next();
        KeyWrapper partitionKey = each.getKey();
        TopNKeyFilter filter = each.getValue();
        log.debug("Checking TopN Filter efficiency {}, threshold: {}", filter, efficiencyThreshold);
        if (filter.getTotal() >= checkEfficiencyNumRows && filter.forwardingRatio() >= efficiencyThreshold) {
            log.info("Disabling TopN Filter {}", filter);
            disabledPartitions.add(partitionKey);
        }
    }
}
Also used : KeyWrapper(org.apache.hadoop.hive.ql.exec.KeyWrapper) TopNKeyFilter(org.apache.hadoop.hive.ql.exec.TopNKeyFilter) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 KeyWrapper (org.apache.hadoop.hive.ql.exec.KeyWrapper)1 TopNKeyFilter (org.apache.hadoop.hive.ql.exec.TopNKeyFilter)1