goankur opened a new pull request, #16986: URL: https://github.com/apache/lucene/pull/16986
**(Implemented using AI with human in the loop)** `SortingCodecReader` wraps a segment's float, byte and float16 vector values, but their `copy()` throws `UnsupportedOperationException`. Code that reads one segment's vectors on several threads needs one copy per thread, so it cannot use a sorted reader. A merge into a sorted index (`IndexWriter#addIndexes(CodecReader...)` with an index sort) goes through these classes. #16871 reads merged vectors on the merge workers and needs this. **Change.** The doc-to-ordinal mapping is built once and never changed. So a copy shares the mapping and wraps a copy of the delegate. **Test.** `TestSortingCodecReader#testVectorValuesCopy` sorts a segment with float and byte vectors and checks that a copy returns the same docs, ordinals and vectors as the original. It fails on main with `UnsupportedOperationException`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
