Skip to content
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

Fix max bucket limit in histogram #1703

Merged
merged 2 commits into from Dec 12, 2022
Merged

Fix max bucket limit in histogram #1703

merged 2 commits into from Dec 12, 2022

Conversation

PSeitz
Copy link
Contributor

@PSeitz PSeitz commented Nov 30, 2022

The max bucket limit in histogram was broken, since some code introduced temporary filtering of buckets, which then resulted in an incorrect increment on the bucket count.
The provided solution handles more use cases correctly, but there are still some scenarios unhandled (See #1702).

quickwit-oss/quickwit#2503

The max bucket limit in histogram was broken, since some code introduced temporary filtering of buckets, which then resulted into an incorrect increment on the bucket count.
The provided solution covers more scenarios, but there are still some scenarios unhandled (See #1702).
Copy link
Collaborator

@fulmicoton fulmicoton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

.iter()
.take_while(|bucket| bucket.doc_count <= self.min_doc_count)
.count();
let cut_off_buckets_end = self
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick... The opposite of front is back.

Suggested change
let cut_off_buckets_end = self
let cut_off_buckets_back = self

Co-authored-by: Paul Masurel <paul@quickwit.io>
@codecov-commenter
Copy link

Codecov Report

Merging #1703 (644a8b2) into main (4958243) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1703      +/-   ##
==========================================
+ Coverage   94.06%   94.11%   +0.04%     
==========================================
  Files         259      261       +2     
  Lines       49637    50009     +372     
==========================================
+ Hits        46692    47066     +374     
+ Misses       2945     2943       -2     
Impacted Files Coverage Δ
src/aggregation/bucket/histogram/histogram.rs 99.56% <100.00%> (+0.01%) ⬆️
fastfield_codecs/src/lib.rs 98.89% <0.00%> (ø)
fastfield_codecs/src/null_index/dense.rs 99.37% <0.00%> (ø)
fastfield_codecs/src/null_index/mod.rs 100.00% <0.00%> (ø)
src/schema/schema.rs 98.91% <0.00%> (+0.13%) ⬆️
src/postings/stacker/term_hashmap.rs 100.00% <0.00%> (+0.56%) ⬆️
src/fastfield/multivalued/mod.rs 99.22% <0.00%> (+0.77%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@PSeitz PSeitz merged commit 2c50b02 into main Dec 12, 2022
@PSeitz PSeitz deleted the histogram_max_bucket branch December 12, 2022 03:40
This was referenced Jan 13, 2023
Hodkinson pushed a commit to Hodkinson/tantivy that referenced this pull request Jan 30, 2023
* Fix max bucket limit in histogram

The max bucket limit in histogram was broken, since some code introduced temporary filtering of buckets, which then resulted into an incorrect increment on the bucket count.
The provided solution covers more scenarios, but there are still some scenarios unhandled (See quickwit-oss#1702).

* Apply suggestions from code review

Co-authored-by: Paul Masurel <paul@quickwit.io>

Co-authored-by: Paul Masurel <paul@quickwit.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants