use of org.apache.drill.exec.work.filter.RuntimeFilterDef 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;
}
use of org.apache.drill.exec.work.filter.RuntimeFilterDef in project drill by apache.
the class RuntimeFilterVisitor method visitJoin.
@Override
public Prel visitJoin(JoinPrel prel, Void value) throws RuntimeException {
if (prel instanceof HashJoinPrel) {
HashJoinPrel hashJoinPrel = (HashJoinPrel) prel;
// Generate possible RuntimeFilterDef to the HashJoinPrel, identify the corresponding
// probe side ScanPrel.
RuntimeFilterDef runtimeFilterDef = generateRuntimeFilter(hashJoinPrel);
hashJoinPrel.setRuntimeFilterDef(runtimeFilterDef);
}
return visitPrel(prel, value);
}
Aggregations