-
Notifications
You must be signed in to change notification settings - Fork 2k
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 MissingValues for Lucene 10 #17647
base: main
Are you sure you want to change the base?
Conversation
With the Lucene 10 upgrade, we should not rely on doc values returning NO_MORE_DOCS once they've run out of ords. Instead, we should return a correct value for docValueCount(). Signed-off-by: Michael Froh <[email protected]>
5151667
to
71f1b16
Compare
@@ -359,7 +360,8 @@ public long getValueCount() { | |||
|
|||
@Override | |||
public int docValueCount() { | |||
return Math.max(1, values.docValueCount()); | |||
// If we don't have ordinals, then we just have the missing value | |||
return hasOrds ? values.docValueCount() : 1; | |||
} |
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.
The nextOrd()
just below this is also not checking for docValueCount.
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.
That's okay. If the caller calls nextOrd()
too many times, the behavior is undefined.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17647 +/- ##
============================================
- Coverage 72.53% 72.42% -0.11%
+ Complexity 65826 65756 -70
============================================
Files 5311 5311
Lines 305073 305073
Branches 44243 44245 +2
============================================
- Hits 221293 220964 -329
- Misses 65688 65995 +307
- Partials 18092 18114 +22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
With the Lucene 10 upgrade, we should not rely on doc values returning NO_MORE_DOCS once they've run out of ords. Instead, we should return a correct value for docValueCount().
Related Issues
Resolves #17628
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.