Search in sources :

Example 1 with RuntimeFilterReporter

use of org.apache.drill.exec.work.filter.RuntimeFilterReporter in project drill by apache.

the class HashJoinBatch method initializeRuntimeFilter.

/**
 * Note: This method can not be called again as part of recursive call of
 * executeBuildPhase() to handle spilled build partitions.
 */
private void initializeRuntimeFilter() {
    if (!enableRuntimeFilter || bloomFiltersGenerated) {
        return;
    }
    runtimeFilterReporter = new RuntimeFilterReporter((ExecutorFragmentContext) context);
    RuntimeFilterDef runtimeFilterDef = popConfig.getRuntimeFilterDef();
    // RuntimeFilterRouter's judgement will have the RuntimeFilterDef.
    if (runtimeFilterDef != null) {
        List<BloomFilterDef> bloomFilterDefs = runtimeFilterDef.getBloomFilterDefs();
        for (BloomFilterDef bloomFilterDef : bloomFilterDefs) {
            int buildFieldId = bloomFilterDef2buildId.get(bloomFilterDef);
            int numBytes = bloomFilterDef.getNumBytes();
            String probeField = bloomFilterDef.getProbeField();
            probeFields.add(probeField);
            BloomFilter bloomFilter = new BloomFilter(numBytes, context.getAllocator());
            bloomFilters.add(bloomFilter);
            bloomFilter2buildId.put(bloomFilter, buildFieldId);
        }
    }
    bloomFiltersGenerated = true;
}
Also used : ExecutorFragmentContext(org.apache.drill.exec.ops.ExecutorFragmentContext) BloomFilterDef(org.apache.drill.exec.work.filter.BloomFilterDef) RuntimeFilterReporter(org.apache.drill.exec.work.filter.RuntimeFilterReporter) RuntimeFilterDef(org.apache.drill.exec.work.filter.RuntimeFilterDef) BloomFilter(org.apache.drill.exec.work.filter.BloomFilter)

Aggregations

ExecutorFragmentContext (org.apache.drill.exec.ops.ExecutorFragmentContext)1 BloomFilter (org.apache.drill.exec.work.filter.BloomFilter)1 BloomFilterDef (org.apache.drill.exec.work.filter.BloomFilterDef)1 RuntimeFilterDef (org.apache.drill.exec.work.filter.RuntimeFilterDef)1 RuntimeFilterReporter (org.apache.drill.exec.work.filter.RuntimeFilterReporter)1