Sort the documents according to the indexSort during the refresh time#21468
Sort the documents according to the indexSort during the refresh time#21468chaitanya588 wants to merge 2 commits into
Conversation
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit c933031.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
29ca47a to
6a19587
Compare
| */ | ||
| default int newToOld(int newDocId) { | ||
| return newDocId; | ||
| } |
There was a problem hiding this comment.
Would it be better to have a single signature only?
1We can convert RowIdMapping in merge flow to Map<Generation(Long), RowIdMapping>
There was a problem hiding this comment.
Also, lets not implement these methods in the interface. We should implement these in each class.
There was a problem hiding this comment.
Changed the interface to meet merge reordered use case (i.e including both newToOld and oldToNew). Also, changed the the RowMapping to capture the mapping details only for one generation.
6a19587 to
384f605
Compare
| */ | ||
| default int newToOld(int newDocId) { | ||
| return newDocId; | ||
| } |
There was a problem hiding this comment.
Also, lets not implement these methods in the interface. We should implement these in each class.
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.concurrent.Executor; | ||
| import java.util.concurrent.locks.ReentrantLock; |
| // Force merge to exactly 1 segment to maintain 1:1 mapping with other formats. | ||
| // If sort permutation is provided, configure the reorder merge policy | ||
| if (flushInput.hasRowIdMapping()) { | ||
| configureSortedMerge(flushInput.rowIdMapping()); |
There was a problem hiding this comment.
It is possible that there are multiple segments before this step [as lucene may internally decide to flush]. We should ensure that there is only segment before this is kicked in? Or would reorder take care of the same?
There was a problem hiding this comment.
Current reorder logic is going to take care a cases where more than 1 segment is present within this flow. I added a test case to cover this (testSortedFlushWithMultipleInternalSegments).
| if (rewriteRowIds == false) { | ||
| return delegate.docValuesFormat(); | ||
| } | ||
| DocValuesFormat delegateFormat = delegate.docValuesFormat(); |
There was a problem hiding this comment.
Can we move this into a separate class?
There was a problem hiding this comment.
Refactored the changes.
384f605 to
22386be
Compare
PR Code Suggestions ✨Latest suggestions up to 3f08261 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 3f08261
Suggestions up to commit 9294e20
Suggestions up to commit ef53768
Suggestions up to commit b5ea63e
|
|
❌ Gradle check result for b5ea63e: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
b5ea63e to
ef53768
Compare
|
❌ Gradle check result for ef53768: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
ef53768 to
9294e20
Compare
PR Reviewer Guide 🔍(Review updated until commit 3f08261)Here are some key observations to aid the review process:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #21468 +/- ##
============================================
+ Coverage 73.50% 73.54% +0.04%
- Complexity 74644 74674 +30
============================================
Files 5980 5980
Lines 338777 338797 +20
Branches 48848 48853 +5
============================================
+ Hits 249011 249162 +151
+ Misses 69946 69816 -130
+ Partials 19820 19819 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Chaitanya KSR <ksrchai@amazon.com>
9294e20 to
3f08261
Compare
|
Persistent review updated to latest commit 3f08261 |
|
❌ Gradle check result for 3f08261: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 3f08261 |
|
❌ Gradle check result for 3f08261: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Chaitanya KSR <ksrchai@amazon.com>
3f08261 to
c933031
Compare
Description
Description
[Describe what this change achieves]
Note: All the Inner classes RowIdMappingSortField, RemappedNumericDocValues, RowIdRemappingCodecReader, RowIdRemappingDocValuesProducer — will get added with all the testing details as part of a follow up LuceneMerge PR.
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
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.