clintropolis commented on code in PR #13364:
URL: https://github.com/apache/druid/pull/13364#discussion_r1022172398
##########
processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexedWriter.java:
##########
@@ -337,15 +340,7 @@ public static int unsignedCompare(
if (b2 == null) {
return 1;
}
- final int commonLength = Math.min(b1.length, b2.length);
-
- for (int i = 0; i < commonLength; i++) {
- final int cmp = FrontCodedIndexed.unsignedByteCompare(b1[i], b2[i]);
- if (cmp != 0) {
- return cmp;
- }
- }
- return Integer.compare(b1.length, b2.length);
+ return StringUtils.compareUtf8(b1, b2);
Review Comment:
I think for now this should probably use
`compareUtf8UsingJavaStringOrdering`, additionally, these lines
https://github.com/apache/druid/blob/master/processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java#L358
and
https://github.com/apache/druid/blob/master/processing/src/main/java/org/apache/druid/segment/data/FrontCodedIndexed.java#L406
should also be updated to use `compareUtf8UsingJavaStringOrderingSingleByte`
--
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]