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

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


The following commit(s) were added to refs/heads/master by this push:
     new 732a7b9  Add more key/value pairs into LOG2M_TO_SIZE_IN_BYTES in 
HllSizeUtils (#4398)
732a7b9 is described below

commit 732a7b9228cb602f685909460e44a4ef76e77272
Author: Bo Zhang <44179472+bozhang2...@users.noreply.github.com>
AuthorDate: Wed Jul 3 15:13:39 2019 -0700

    Add more key/value pairs into LOG2M_TO_SIZE_IN_BYTES in HllSizeUtils (#4398)
---
 .../java/org/apache/pinot/startree/hll/HllSizeUtils.java   | 14 +++++++++++++-
 .../apache/pinot/core/startree/hll/HllFieldSizeTest.java   |  2 +-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git 
a/pinot-common/src/main/java/org/apache/pinot/startree/hll/HllSizeUtils.java 
b/pinot-common/src/main/java/org/apache/pinot/startree/hll/HllSizeUtils.java
index 065948b..9d0ab4b 100644
--- a/pinot-common/src/main/java/org/apache/pinot/startree/hll/HllSizeUtils.java
+++ b/pinot-common/src/main/java/org/apache/pinot/startree/hll/HllSizeUtils.java
@@ -28,7 +28,19 @@ import com.google.common.collect.ImmutableBiMap;
 public class HllSizeUtils {
 
   private static final ImmutableBiMap<Integer, Integer> LOG2M_TO_SIZE_IN_BYTES 
=
-      ImmutableBiMap.of(5, 32, 6, 52, 7, 96, 8, 180, 9, 352);
+      ImmutableBiMap.<Integer, Integer>builder()
+          .put(5, 32)
+          .put(6, 52)
+          .put(7, 96)
+          .put(8, 180)
+          .put(9, 352)
+          .put(10, 692)
+          .put(11, 1376)
+          .put(12, 2740)
+          .put(13, 5472)
+          .put(14, 10932)
+          .put(15, 21856)
+          .build();
 
   public static ImmutableBiMap<Integer, Integer> getLog2mToSizeInBytes() {
     return LOG2M_TO_SIZE_IN_BYTES;
diff --git 
a/pinot-core/src/test/java/org/apache/pinot/core/startree/hll/HllFieldSizeTest.java
 
b/pinot-core/src/test/java/org/apache/pinot/core/startree/hll/HllFieldSizeTest.java
index c2b5a6e..6bfcef8 100644
--- 
a/pinot-core/src/test/java/org/apache/pinot/core/startree/hll/HllFieldSizeTest.java
+++ 
b/pinot-core/src/test/java/org/apache/pinot/core/startree/hll/HllFieldSizeTest.java
@@ -34,7 +34,7 @@ public class HllFieldSizeTest {
   @Test
   public void testHllFieldSerializedSize()
       throws Exception {
-    for (int i = 5; i < 10; i++) {
+    for (int i = 5; i < 16; i++) {
       HyperLogLog hll = new HyperLogLog(i);
       Assert.assertEquals(HllSizeUtils.getHllFieldSizeFromLog2m(i), 
hll.getBytes().length);
       LOGGER.info("Estimated: " + hll.cardinality());


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

Reply via email to