davecromberge commented on code in PR #14373:
URL: https://github.com/apache/pinot/pull/14373#discussion_r1856269239


##########
pinot-core/src/main/java/org/apache/pinot/core/segment/processing/aggregator/DistinctCountCPCSketchAggregator.java:
##########
@@ -30,7 +31,7 @@ public DistinctCountCPCSketchAggregator() {
   }
 
   @Override
-  public Object aggregate(Object value1, Object value2) {
+  public Object aggregate(Object value1, Object value2, Map<String, String> 
functionParameters) {

Review Comment:
   Alternatively, we might instantiate each value aggregator with the relevant 
parameters but this would need to be baked into the constructors.  For example, 
in the `ValueAggregatorFactory`:
   
   ```
   public static ValueAggregator getValueAggregator(AggregationFunctionType 
aggregationType, DataType dataType) {
       Map<String, String> params = getAggregationFunctionParameters;
   
       switch (aggregationType) {
         case MIN:
           return new MinValueAggregator(dataType);
         case MAX:
           return new MaxValueAggregator(dataType);
         case SUM:
           return new SumValueAggregator(dataType);
         case DISTINCTCOUNTHLL:
         case DISTINCTCOUNTRAWHLL:
           return new DistinctCountHLLAggregator();
         case DISTINCTCOUNTTHETASKETCH:
         case DISTINCTCOUNTRAWTHETASKETCH:
           return new 
DistinctCountThetaSketchAggregator(Integer.parseInt(params.get("_sketchNominalEntries")));
         case DISTINCTCOUNTTUPLESKETCH:
         case DISTINCTCOUNTRAWINTEGERSUMTUPLESKETCH:
         case SUMVALUESINTEGERSUMTUPLESKETCH:
         case AVGVALUEINTEGERSUMTUPLESKETCH:
           return new IntegerTupleSketchAggregator(IntegerSummary.Mode.Sum);
         case DISTINCTCOUNTCPCSKETCH:
         case DISTINCTCOUNTRAWCPCSKETCH:
           return new DistinctCountCPCSketchAggregator();
         case DISTINCTCOUNTULL:
         case DISTINCTCOUNTRAWULL:
           return new DistinctCountULLAggregator();
         default:
           throw new IllegalStateException("Unsupported aggregation type: " + 
aggregationType);
       }
   
   ```



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to