-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-19527][Core] Approximate Size of Intersection of Bloom Filters #16864
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
Changes from 1 commit
7a3ad46
b9680c5
501ad7e
c2a775d
40a3954
ea554a6
9cd7165
0ac7bf1
0a3910e
8ec6092
5e085c0
d1921f8
2cbf490
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
… Also function to create union (non-mutation) of two Bloom filters.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,6 +80,11 @@ int getVersionNumber() { | |
| */ | ||
| public abstract long bitSize(); | ||
|
|
||
| /** | ||
| * Swamidass & Baldi (2007) approximation for number of items in a Bloom filter | ||
| */ | ||
| public abstract double approxItems(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't this return a long rather than a double?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was debating this due to possible rounding errors.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea but that would only be off by 1. I wouldn't worry about that since it is approximate anyway.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be easier to keep it as double because the estimate could be out of bound if the bits are full. |
||
|
|
||
| /** | ||
| * Puts an item into this {@code BloomFilter}. Ensures that subsequent invocations of | ||
| * {@linkplain #mightContain(Object)} with the same item will always return {@code true}. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.spark.util.sketch; | ||
|
|
||
| public class IncompatibleUnionException extends Exception { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need some javadoc ere. |
||
| public IncompatibleUnionException(String message) { | ||
| super(message); | ||
| } | ||
| } | ||
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.
Please describe the method first and its properties (approximation error). Then put the reference in
@seealsowith a permanent link to the paper: https://dx.doi.org/10.1021%2Fci600526a