-
Notifications
You must be signed in to change notification settings - Fork 347
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
Added Aggregators for BloomFilter, CountMinSketch, MapSketch, HyperLogLog, Moments, Min, Max #194
Conversation
val monoid = hllMonoid | ||
|
||
def prepare(value: Array[Byte]) = monoid.create(value) | ||
def present(hll: HLL) = hll |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does present want to be the HLL here, or the estimate? I can see arguments either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the estimate would be the nicer output but I'm not actually using HLL so I don't know how useful others would find having the actual HLL instance.
Nice work. Really appreciate this! Make a few return types and I'll merge. |
} | ||
} | ||
|
||
case class HyperLogLogAggregator(val hllMonoid: HyperLogLogMonoid) extends MonoidAggregator[Array[Byte], HLL, Double] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We often store the HLL. Let's keep the HLL as the return type and if you want size you can use
.andThenPresent(_.estimateSize)
to get it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you also want a size estimating one, that's fine, HLLSizeAggregator or something, so you don't have to do the above andThen over and over.
* Fixed return types. * Added aggregator that returns HLL size.
Looks good. Thanks! |
Added Aggregators for BloomFilter, CountMinSketch, MapSketch, HyperLogLog, Moments, Min, Max
Added Aggregators for BloomFilter, CountMinSketch, MapSketch, HyperLogLog, Moments, Min, Max with some testing. Are there any other classes that should also have aggregators added?
This should address #190.