forked from airlift/airlift
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Off-by-one bug in calculation of zeros in SparseHll::toDense #42
Comments
Do we understand the implications of this in correctness in production? |
jonhehir
added a commit
to jonhehir/airlift
that referenced
this issue
Jun 24, 2022
This commit makes no functional changes and only adds tests. Beyond merely improving test coverage, this commit serves as partial documentation of one minor (but surprising) edge case (issue to be filed) and as verification of behavior that was contested in prestodb#42.
jonhehir
added a commit
to jonhehir/airlift
that referenced
this issue
Jun 24, 2022
This commit makes no functional changes and only adds tests. Beyond merely improving test coverage, this commit serves as partial documentation of one minor (but surprising) edge case (prestodb#56) and as verification of behavior that was contested in prestodb#42.
Per the unit tests in #55, it seems the correct values are being recorded. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I noticed a bug in SparseHll::toDense while porting HLL algorithm to C++.
https://github.com/airlift/airlift/blob/master/stats/src/main/java/io/airlift/stats/cardinality/SparseHll.java#L175
Here, decodeBucketValue has the number of zeros + 1, hence, the +1 in
listener.visit(bucket, zeros + 1);
will add an extra one.See airlift#926
CC: @arhimondr @rongrong @tdcmeehan @highker
The text was updated successfully, but these errors were encountered: