ankitsultana commented on code in PR #14981:
URL: https://github.com/apache/pinot/pull/14981#discussion_r1941785723


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/groupby/GroupIdGeneratorFactory.java:
##########
@@ -25,24 +25,27 @@ public class GroupIdGeneratorFactory {
   private GroupIdGeneratorFactory() {
   }
 
-  public static GroupIdGenerator getGroupIdGenerator(ColumnDataType[] 
keyTypes, int numKeyColumns, int numGroupsLimit) {
+  public static GroupIdGenerator getGroupIdGenerator(ColumnDataType[] 
keyTypes, int numKeyColumns,
+      int numGroupsLimit, int maxInitialResultHolderCapacity) {
+    // Initial capacity is one more than expected to avoid rehashing if 
container is full.
+    int initialCapacity = 1 + Math.min(maxInitialResultHolderCapacity, 
numGroupsLimit);

Review Comment:
   Hash table resize would happen based on load factor though right? Adding 1 
here might not do much. (default is usually 0.75)



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