dfengliu commented on code in PR #20447:
URL: https://github.com/apache/druid/pull/20447#discussion_r4258765052


##########
processing/src/main/java/org/apache/druid/segment/data/GenericIndexed.java:
##########
@@ -599,9 +633,17 @@ public T get(final int index)
     }
 
     @Nullable
-    ByteBuffer bufferedIndexedGetByteBuffer(ByteBuffer copyValueBuffer, int 
startOffset, int endOffset)
+    ByteBuffer bufferedIndexedGetByteBuffer(ByteBuffer copyValueBuffer, int 
startOffset, int endOffset, int bufferLimit)
     {
       int size = endOffset - startOffset;
+      if (startOffset < Integer.BYTES || endOffset < startOffset || endOffset 
> bufferLimit) {

Review Comment:
   @FrankChen021 Thank you — fixed in 73fe9200. The marker is now read through 
a dedicated view captured at the stable original limit (one per V1 closure, one 
per value file for V2), so it no longer depends on the reused buffer's narrowed 
limit, and the shared value buffer is not mutated for the marker check at all. 
Added `testSingleThreadedEmptyAndNullValues` covering successive lookups over 
an empty and a null value; it reproduced the IndexOutOfBoundsException before 
the fix and passes now.



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