private static AggregationDesc bloomFilterAggregation(GenericUDAFEvaluator.Mode mode, ExprNodeDesc col,
      SelectOperator source, long numEntriesHint, HiveConf conf) {
    GenericUDAFBloomFilterEvaluator bloomFilterEval = new GenericUDAFBloomFilterEvaluator();
    bloomFilterEval.setSourceOperator(source);
    bloomFilterEval.setMaxEntries(conf.getLongVar(HiveConf.ConfVars.TEZ_MAX_BLOOM_FILTER_ENTRIES));
    bloomFilterEval.setMinEntries(conf.getLongVar(HiveConf.ConfVars.TEZ_MIN_BLOOM_FILTER_ENTRIES));
    bloomFilterEval.setFactor(conf.getFloatVar(HiveConf.ConfVars.TEZ_BLOOM_FILTER_FACTOR));
    bloomFilterEval.setHintEntries(numEntriesHint);

    List<ExprNodeDesc> params;

    // numThreads is available only for VectorUDAFBloomFilterMerge, which only supports
    // these two modes, don't add numThreads otherwise
    switch(mode) {
      case PARTIAL2:
      case FINAL:
        int numThreads = conf.getIntVar(HiveConf.ConfVars.TEZ_BLOOM_FILTER_MERGE_THREADS);
        TypeInfo intTypeInfo = TypeInfoFactory.getPrimitiveTypeInfoFromJavaPrimitive(Integer.TYPE);
        params = Arrays.asList(col, new ExprNodeConstantDesc(intTypeInfo, numThreads));
        break;
    default:
      params = Collections.singletonList(col);
      break;
    }

    AggregationDesc bloom = new AggregationDesc(BLOOM_FILTER_FUNCTION, bloomFilterEval, params, false, mode);
    // It is necessary to set the bloom filter evaluator otherwise there are runtime failures see HIVE-24018
    bloom.setGenericUDAFWritableEvaluator(bloomFilterEval);
    return bloom;
  }
Creates a group by operator with min, max, and bloomFilter aggregations for every column of the parent.
<p>
The method generates two kind of group by operators for intermediate and final aggregations respectively.
Intermediate aggregations require the parent operator to be a select operator while final aggregations assume that
the parent is a reduce sink operator.
</p>
<p>
Intermediate group by example.
<pre>
Input: SEL[fname, lname, age, hash(fname,lname,age)]
Output: GBY[min(fname),max(fname),min(lname),max(lname),min(age),max(age),bloom(hash)]
</pre>
</p>
<p>
Final group by example.
<pre>
Input: RS[fname_min,fname_max,lname_min,lname_max,age_min,age_max, hash_bloom]
Output: GBY[min(fname_min),max(fname_max),min(lname_min),max(lname_max),min(age_min),max(age_max),bloom(hash_bloom)]
</pre>
</p>
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SemiJoinReductionMerge.java