tarun11Mavani commented on code in PR #18760:
URL: https://github.com/apache/pinot/pull/18760#discussion_r3464551328


##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/funnel/BitmapAggregationStrategy.java:
##########
@@ -37,8 +37,18 @@ public DictIdsWrapper createAggregationResult(Dictionary 
dictionary) {
     return new DictIdsWrapper(_numSteps, dictionary);
   }
 
+  @Override
+  public DictIdsWrapper createAggregationResultMultiKey(Dictionary[] 
dictionaries) {
+    return new DictIdsWrapper(_numSteps, dictionaries);
+  }
+
   @Override
   protected void add(Dictionary dictionary, DictIdsWrapper dictIdsWrapper, int 
step, int correlationId) {
     dictIdsWrapper._stepsBitmaps[step].add(correlationId);
   }
+
+  @Override
+  void addMultiKey(DictIdsWrapper dictIdsWrapper, int step, Dictionary[] 
dictionaries, int[] correlationDictIds) {
+    
dictIdsWrapper._stepsBitmaps[step].add(dictIdsWrapper.getCompositeCorrelationId(correlationDictIds));

Review Comment:
   On the stride path (common case), getCompositeCorrelationId is just 
multiply-add arithmetic — caching costs more than it saves (array comparison 
overhead > a few multiplies).  
   
   On the HashMap path (rare overflow case), repeated map lookups per step do 
cost more, but this path is already exceptional. And the number of repeated 
calls per row is bounded by the number of matching steps (typically 2-5).
   
   Hence, I feel we are better off without any cache here.



-- 
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]

Reply via email to