gortiz commented on code in PR #19589:
URL: https://github.com/apache/pinot/pull/19589#discussion_r4539021265


##########
pinot-core/src/main/java/org/apache/pinot/core/operator/dociditerators/SVScanDocIdIterator.java:
##########
@@ -142,6 +142,13 @@ public MutableRoaringBitmap applyAnd(BatchIterator 
docIdIterator, OptionalInt fi
     return result.get();
   }
 
+  @Override
+  public int matchDocIds(int[] docIds, int limit) {
+    _numEntriesScanned += limit;
+    // matchValues already compacts the matching document ids to the front of 
the array
+    return _valueMatcher.matchValues(limit, docIds);

Review Comment:
   Good catch. Fixed in 6bb3ef83d8: `SVScanDocIdIterator#matchDocIds` now 
matches a chunk that is larger than its batch size one batch at a time, so the 
matcher buffers are never overrun. 
`RestrictedScanDocIdIteratorTest#testChunkLargerThanTheScanBatchSize` uses a 
1041-document chunk over a 256-document scan. Without the fix it fails with 
`ArrayIndexOutOfBoundsException: Index 256 out of bounds for length 256`.
   
   I also rebased the spike on master. #19408 is merged, so the diff now has 
only the spike commits.



-- 
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]

Reply via email to