You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/11/14 23:41:57 UTC
[GitHub] [druid] clintropolis commented on a diff in pull request #13364: Add various string comparison methods to StringUtils, to be used later.
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org