-
Notifications
You must be signed in to change notification settings - Fork 71
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
Out-of-bounds when a blank HLL is unioned with a smaller blank HLL #11
Comments
@Akninirith Thanks for pointing this out! This should throw an If you have an immediate use case involving the union of different |
There isn't a use case for this, at the moment at least, but if that changes this thread will be notified ASAP. Regardless, thank you for the timely response! |
Is this discussed to be case unioning any kind of HLL with EMPTY/EXPLICIT ? Am I correct that for different log2m & regwidth there will be different subsets of bits and different values for counters (both counter # and value to be set), so, basically this would be no-go to correctly merge one counters to another? Or there are cases when this possible? |
@ghost one scenario is hundreds of thousands of sparse HLL_s (or even millions) with a small regwidth_s is stored in disk. Later, merging happens into a single full HLL_m that can represent bigger cardinality values (regwidth_m>=regwidth_s) just for the purpose of computing the cardinality of the union. For this scenario, HLL_m would not be persisted. That might save disk storage and even reduce read cost. |
This may fail suprisingly, though. Even though it's a known issue that won't get solved as it is deemed unimportant / too cornery, I think it should at least get accurately documented. |
A union operation done on two HLL objects immediately after they are initialized, with a smaller log2m in the parameter HLL than the one doing the union, throws an ArrayIndexOutOfBoundsException. The below code should be capable of reproducing this error.
HLL shortHLL = new HLL(14, 6, -1, false, HLLType.FULL);
HLL longHLL = new HLL(18, 6, -1, false, HLLType.FULL);
longHLL.union(shortHLL);
The text was updated successfully, but these errors were encountered: