[ 
https://issues.apache.org/jira/browse/HIVE-23095?focusedWorklogId=418477&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-418477
 ]

ASF GitHub Bot logged work on HIVE-23095:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Apr/20 12:22
            Start Date: 08/Apr/20 12:22
    Worklog Time Spent: 10m 
      Work Description: kgyrtkirk commented on pull request #964: HIVE-23095 
ndv 70
URL: https://github.com/apache/hive/pull/964#discussion_r405482181
 
 

 ##########
 File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/common/ndv/hll/HLLSparseRegister.java
 ##########
 @@ -148,8 +148,12 @@ public int encodeHash(long hashcode) {
     }
   }
 
-  public int getSize() {
-    return sparseMap.size() + tempListIdx;
+  public boolean isSizeGreaterThan(int s) {
+    if (sparseMap.size() + tempListIdx > s) {
+      mergeTempListToSparseMap();
 
 Review comment:
   we are using:
   * sizeOptimized => p=10
   * bitpacking is enabled by default 
   formula to count the threshold in this case is: 
   ```
   2**p * 6/8/5 = ~150
   ```
   
https://github.com/apache/hive/blob/d91cc0cd84b7d0ecc0f29d44b109b46e21194eec/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/common/ndv/hll/HyperLogLog.java#L116
   
   I also found that a little too few...but that's what it is...
   
   all changes are here; this conversation is on a diff which is "outdated"
   
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 418477)
    Time Spent: 50m  (was: 40m)

> NDV might be overestimated for a table with ~70 value
> -----------------------------------------------------
>
>                 Key: HIVE-23095
>                 URL: https://issues.apache.org/jira/browse/HIVE-23095
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-23095.01.patch, HIVE-23095.02.patch, 
> HIVE-23095.03.patch, HIVE-23095.04.patch, HIVE-23095.04.patch, 
> HIVE-23095.04.patch, HIVE-23095.05.patch, hll-bench.md
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> uncovered during looking into HIVE-23082
> https://issues.apache.org/jira/browse/HIVE-23082?focusedCommentId=17067773&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17067773



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to