Repository navigation
Frequent items: raise a threshold below the maximum error to it, as Java, Go and Rust do - #604
Draft
stojkomilos wants to merge 1 commit into
Draft
stojkomilos wants to merge 1 commit into
stojkomilos wants to merge 1 commit into
Conversation
get_frequent_items(err_type, threshold) now uses max(threshold, offset), as datasketches-java, -go and -rust do. The one-argument overload already passed the maximum error. Co-authored-by: Isaac <no-reply@databricks.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
get_frequent_items(err_type, threshold)now usesmax(threshold, get_maximum_error())as its threshold. Before, it used the threshold as passed. The one-argument overload already passed the maximum error, so it does not change.Java, Go and Rust already do this:
This makes C++ match them. The doc comment of the two-argument overload says the same.
Callers with an explicit threshold below the maximum error get fewer rows. With
NO_FALSE_POSITIVES, an item whose lower bound is at or below the offset could be returned before, even though the sketch may have dropped items as frequent as it. The Python binding (datasketches-python) passes a nonzero threshold through, so it changes too. Its threshold 0 already means the maximum error.Checks
frequent items: threshold below the maximum error is raised to itfails on master (NO_FALSE_POSITIVESwith threshold 0 returns item 8) and passes with this change.fi_testpasses on Release: 30 test cases, 175 assertions.fi_testpasses under ASan and UBSan with no sanitizer reports (GCC 10.5).This pull request and its description were written by Isaac.