You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2023/01/01 18:18:49 UTC

[GitHub] [pinot] richardstartin commented on a diff in pull request #10044: push unsigned byte comparison down into ValueReader

richardstartin commented on code in PR #10044:
URL: https://github.com/apache/pinot/pull/10044#discussion_r1059782099


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/readers/BaseImmutableDictionary.java:
##########
@@ -259,8 +259,7 @@ protected int binarySearch(byte[] value) {
 
     while (low <= high) {
       int mid = (low + high) >>> 1;
-      byte[] midValue = _valueReader.getBytes(mid, _numBytesPerValue);
-      int compareResult = ByteArray.compare(midValue, value);
+      int compareResult = _valueReader.compareUnsignedBytes(mid, _numBytesPerValue, value);

Review Comment:
   this introduces a bug as things stand as it will compare to the prefix before the first zero in the stored data, I will fix this soon and add some testing around this scenario.



-- 
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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org