Skip to content

Optional Iterator refactor - [MOD-8844]#6260

Merged
BenGoldberger merged 83 commits intomasterfrom
optional-Iterator-refactor
Jun 18, 2025
Merged

Optional Iterator refactor - [MOD-8844]#6260
BenGoldberger merged 83 commits intomasterfrom
optional-Iterator-refactor

Conversation

@BenGoldberger
Copy link
Collaborator

It contains the code for the Optional Iterator refactor.

Implementation has been taken from https://github.com/RediSearch/RediSearch/pull/5619/files

@github-actions github-actions bot added the size:L label Jun 5, 2025
@GuyAv46 GuyAv46 changed the base branch from master to guyav-refactor_index_iterator June 8, 2025 12:09
@codecov
Copy link

codecov bot commented Jun 8, 2025

Codecov Report

Attention: Patch coverage is 95.71429% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.77%. Comparing base (52cbc9c) to head (7ef16e8).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/iterators/optional_iterator.c 95.71% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6260      +/-   ##
==========================================
- Coverage   88.79%   88.77%   -0.02%     
==========================================
  Files         244      246       +2     
  Lines       40978    41051      +73     
  Branches     3483     3483              
==========================================
+ Hits        36385    36444      +59     
- Misses       4550     4564      +14     
  Partials       43       43              
Flag Coverage Δ
flow 81.85% <0.00%> (-0.30%) ⬇️
unit 46.47% <95.71%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

GuyAv46
GuyAv46 previously approved these changes Jun 17, 2025
JoanFM
JoanFM previously approved these changes Jun 17, 2025
@BenGoldberger BenGoldberger added this pull request to the merge queue Jun 18, 2025

// Create a new OPTIONAL iterator - Non-Optimized version.
QueryIterator *IT_V2(NewOptionalIterator)(QueryIterator *it, t_docId maxDocId, size_t numDocs, double weight) {
assert(it != NULL);
Copy link
Collaborator

Choose a reason for hiding this comment

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

On a second look, this may happen (for example, when searching for ~foo but no document has foo so there is no inverted index for it)
I suggest we return a wildcard iterator in this case.
We have to check the implications on FT.PROFILE and FT.EXPLAIN when we start using the new iterators

Copy link
Collaborator

Choose a reason for hiding this comment

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

alternativly, use RS_ASSERT and we will have to handle this case when using the API

Merged via the queue into master with commit 341f4d4 Jun 18, 2025
15 checks passed
@BenGoldberger BenGoldberger deleted the optional-Iterator-refactor branch June 18, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants