You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by xi...@apache.org on 2020/05/21 00:17:51 UTC

[incubator-pinot] 01/01: Set hashmap initial size to 16 in DictionaryBasedGroupKeyGenerator.

This is an automated email from the ASF dual-hosted git repository.

xiangfu pushed a commit to branch set_group_by_hash_size
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit b7c6695e7a7d30ad389bdef71855366bd1820295
Author: Xiang Fu <fx...@gmail.com>
AuthorDate: Wed May 20 17:16:53 2020 -0700

    Set hashmap initial size to 16 in DictionaryBasedGroupKeyGenerator.
---
 .../aggregation/groupby/DictionaryBasedGroupKeyGenerator.java      | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java b/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java
index e2da862..c163ffd 100644
--- a/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java
+++ b/pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/groupby/DictionaryBasedGroupKeyGenerator.java
@@ -61,6 +61,7 @@ import org.apache.pinot.core.segment.index.readers.Dictionary;
  * bounded by the number of groups limit (globalGroupIdUpperBound is always smaller or equal to numGroupsLimit).
  */
 public class DictionaryBasedGroupKeyGenerator implements GroupKeyGenerator {
+  private final static int DEFAULT_HASH_MAP_INITIAL_SIZE = 16;
   private final TransformExpressionTree[] _groupByExpressions;
   private final int _numGroupByExpressions;
   private final int[] _cardinalities;
@@ -109,15 +110,15 @@ public class DictionaryBasedGroupKeyGenerator implements GroupKeyGenerator {
 
     if (longOverflow) {
       _globalGroupIdUpperBound = numGroupsLimit;
-      _rawKeyHolder = new ArrayMapBasedHolder(_globalGroupIdUpperBound);
+      _rawKeyHolder = new ArrayMapBasedHolder(DEFAULT_HASH_MAP_INITIAL_SIZE);
     } else {
       if (cardinalityProduct > Integer.MAX_VALUE) {
         _globalGroupIdUpperBound = numGroupsLimit;
-        _rawKeyHolder = new LongMapBasedHolder(_globalGroupIdUpperBound);
+        _rawKeyHolder = new LongMapBasedHolder(DEFAULT_HASH_MAP_INITIAL_SIZE);
       } else {
         _globalGroupIdUpperBound = Math.min((int) cardinalityProduct, numGroupsLimit);
         if (cardinalityProduct > arrayBasedThreshold) {
-          _rawKeyHolder = new IntMapBasedHolder(_globalGroupIdUpperBound);
+          _rawKeyHolder = new IntMapBasedHolder(DEFAULT_HASH_MAP_INITIAL_SIZE);
         } else {
           _rawKeyHolder = new ArrayBasedHolder();
         }


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