-
Notifications
You must be signed in to change notification settings - Fork 345
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
Add Accurate Count-Distinct aggregator (RoaringBitmap) #493
base: develop
Are you sure you want to change the base?
Add Accurate Count-Distinct aggregator (RoaringBitmap) #493
Conversation
I think our main concern with this will be the addition of the dependency. Looks like its pretty pure of a dep, with all the packages it uses seem to be only used in tests. Small enough to be in core you think @johnynek or we should have it in an algebird-X ? |
Yes the dependency is the trick here. This would add a new dependency for everyone, even those that don't use this feature. A second concern is that this would be the second bitset dependency (we took another one, which may have been a mistake): we definitely should not have two compressed bitset dependencies. They claim this performs better than Ewah. If that's true, we should consider just moving to this. In the mean time, it might be better to make the aggregator without adding an additional dependency just by using the current dependency, and then we can evaluate if we should change to only use the RoaringBitmap implementation. That would be my opinon. Also, note, there is a faster aggregation for RoaringBitmap according to the docs: which could be used as the implementation for sumOption on the semigroup, which should speed things up when this is used with spark or scalding. One more comment: if we did merge this, the monoid should probably be in the mutable namespace since this datastructure is mutable (even though we are not mutating it here). |
} | ||
} | ||
|
||
class RoaringBitampSemigroup extends Semigroup[RoaringBitmap] { |
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.
Bitamp
should be Bitmap
(also appears elsewhere)
Agreed that we should pick a compressed bitset to use. It seems worth noting that the author of the EWAH implementation we use (Lemire) is also the author of the RoaringBitmap paper and implementation, which gives his claims about which one is faster a lot of weight. |
good point on
Sounds good. then, I'll look into |
btw, @johnynek , regarding looking again at https://github.com/twitter/algebird/pull/397/files , I see your comment
I wish too! any new ideas how to add this |
4527954
to
f4e38ef
Compare
f4e38ef
to
9e00b8b
Compare
Guess I forgot about that. No new ideas on how to solve it. On Monday, October 5, 2015, vidma [email protected] wrote:
Oscar Boykin :: @posco :: http://twitter.com/posco |
continuing P.S. as I understand even Scalding calls |
yes, for now, we only use sumOption after shuffle. We could do this on the On Mon, Oct 5, 2015 at 12:57 PM, vidma [email protected] wrote:
Oscar Boykin :: @posco :: http://twitter.com/posco |
Scalding only uses it reduce side natively right now, though Summingbird actually will use sumOption mapside optionally. I've used it map side with two general strategies before:
In scalding using sumByLocalKeys it looks something like: .map(specialType).sumByLocalKeys.map(_.present).group.forceToReducers.sum |
vidmantas zemleris seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Internally, this uses
RoaringBitmap
, a compressed alternative toBitSet
(it's rather fast, and used commonly in projects asspark
,druid
etc).This is very simple, but IMHO algebird is still missing this :)
I'll add tests if you'll be willing to merge it (our tests are currently Spark/DataFrame dependent)
@johnynek