You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2018/08/06 09:55:30 UTC

[kylin] branch master updated: KYLIN-3483, fix the loss of precision in HLLCSerializer.

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

shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new 4d61c30  KYLIN-3483, fix the loss of precision in HLLCSerializer.
4d61c30 is described below

commit 4d61c30ebd52c555632933ccdc928f85cc806cfd
Author: tttMelody <24...@qq.com>
AuthorDate: Sun Aug 5 18:10:47 2018 +0800

    KYLIN-3483, fix the loss of precision in HLLCSerializer.
---
 .../src/main/java/org/apache/kylin/measure/hllc/HLLCSerializer.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HLLCSerializer.java b/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HLLCSerializer.java
index 9310864..9ad1695 100644
--- a/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HLLCSerializer.java
+++ b/core-metadata/src/main/java/org/apache/kylin/measure/hllc/HLLCSerializer.java
@@ -85,7 +85,7 @@ public class HLLCSerializer extends DataTypeSerializer<HLLCounter> {
         int registerIndexSize = current().getRegisterIndexSize();
         int m = 1 << precision;
         if (!current().isDense((int) averageNumOfElementsInCounter)
-                || averageNumOfElementsInCounter < (m - 5) / (1 + registerIndexSize)) {
+                || averageNumOfElementsInCounter < (m - 5d) / (1d + registerIndexSize)) {
             // 5 = 1 + 4 for scheme and size
             // size * (getRegisterIndexSize + 1)
             return 5 + averageNumOfElementsInCounter * (registerIndexSize + 1);