swaminathanmanish commented on code in PR #14625:
URL: https://github.com/apache/pinot/pull/14625#discussion_r1885673580
##########
pinot-core/src/main/java/org/apache/pinot/core/segment/processing/aggregator/DistinctCountThetaSketchAggregator.java:
##########
@@ -33,20 +34,26 @@ public DistinctCountThetaSketchAggregator() {
@Override
public Object aggregate(Object value1, Object value2, Map<String, String>
functionParameters) {
- String nominalEntriesParam =
functionParameters.get(Constants.THETA_TUPLE_SKETCH_NOMINAL_ENTRIES);
+ SetOperationBuilder unionBuilder = Union.builder();
- int sketchNominalEntries;
+ String samplingProbabilityParam =
functionParameters.get(Constants.THETA_TUPLE_SKETCH_SAMPLING_PROBABILITY);
+ String nominalEntriesParam =
functionParameters.get(Constants.THETA_TUPLE_SKETCH_NOMINAL_ENTRIES);
- // Check if nominal entries values match
+ // Check if nominal entries is set
if (nominalEntriesParam != null) {
- sketchNominalEntries = Integer.parseInt(nominalEntriesParam);
+ unionBuilder.setNominalEntries(Integer.parseInt(nominalEntriesParam));
} else {
// If the functionParameters don't have an explicit nominal entries
value set,
// use the default value for nominal entries
- sketchNominalEntries =
CommonConstants.Helix.DEFAULT_THETA_SKETCH_NOMINAL_ENTRIES;
+
unionBuilder.setNominalEntries(CommonConstants.Helix.DEFAULT_THETA_SKETCH_NOMINAL_ENTRIES);
+ }
+
+ // Check if sampling probability is set
+ if (samplingProbabilityParam != null) {
+ unionBuilder.setP(Float.parseFloat(samplingProbabilityParam));
Review Comment:
is there a default for samplingProbability as well?
--
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]