asolimando commented on code in PR #3637:
URL: https://github.com/apache/hive/pull/3637#discussion_r1000716525
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SemiJoinReductionMerge.java:
##########
@@ -451,8 +452,22 @@ private static AggregationDesc
bloomFilterAggregation(GenericUDAFEvaluator.Mode
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> p = Collections.singletonList(col);
- AggregationDesc bloom = new AggregationDesc("bloom_filter",
bloomFilterEval, p, false, mode);
+
+ List<ExprNodeDesc> params;
+
+ // numThreads is available only for VectorUDAFBloomFilterMerge, which only
supports
+ // these two modes, don't add numThreads otherwise
+ if (GenericUDAFEvaluator.Mode.PARTIAL2.equals(mode)
+ || GenericUDAFEvaluator.Mode.FINAL.equals(mode)) {
+ int numThreads =
conf.getInt(HiveConf.ConfVars.TEZ_BLOOM_FILTER_MERGE_THREADS.varname,
+ HiveConf.ConfVars.TEZ_BLOOM_FILTER_MERGE_THREADS.defaultIntVal);
+ PrimitiveTypeInfo intTypeInfo =
TypeInfoFactory.getPrimitiveTypeInfo("int");
+ params = Arrays.asList(col, new ExprNodeConstantDesc(intTypeInfo,
numThreads));
+ } else {
+ params = Collections.singletonList(col);
+ }
+
+ AggregationDesc bloom = new AggregationDesc("bloom_filter",
bloomFilterEval, params, false, mode);
Review Comment:
We generally don't but I agree we should, I have decided to put it in
`FunctionRegistry` class, WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]