gortiz commented on code in PR #12242: URL: https://github.com/apache/pinot/pull/12242#discussion_r1452127117
########## pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/forward/VarByteChunkSVForwardIndexReader.java: ########## @@ -103,11 +103,20 @@ private String getStringUncompressed(int docId) { long valueEndOffset = getValueEndOffset(chunkId, chunkRowId, chunkStartOffset); int length = (int) (valueEndOffset - valueStartOffset); - byte[] bytes = _reusableBytes.get(); + byte[] bytes = getOrExpandByteArray(); _dataBuffer.copyTo(valueStartOffset, bytes, 0, length); return new String(bytes, 0, length, UTF_8); } + private byte[] getOrExpandByteArray() { + byte[] bytes = _reusableBytes.get(); + if (bytes == null || bytes.length < _lengthOfLongestEntry) { Review Comment: When can bytes be null? Or changing the question: If we assume bytes can be null, why do we initialize the ThreadLocal with `new byte[0]` instead of `null`? -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org