shaofengshi closed pull request #187: KYLIN-3483, fix the loss of precision in 
HLLCSerializer.
URL: https://github.com/apache/kylin/pull/187
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 9310864916..9ad16952aa 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 @@ protected double getStorageBytesEstimate(double 
averageNumOfElementsInCounter) {
         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);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to