clintropolis commented on code in PR #12773:
URL: https://github.com/apache/druid/pull/12773#discussion_r930550278


##########
processing/src/main/java/org/apache/druid/query/aggregation/SerializablePairLongStringSerde.java:
##########
@@ -46,6 +46,42 @@ public class SerializablePairLongStringSerde extends 
ComplexMetricSerde
 {
 
   private static final String TYPE_NAME = "serializablePairLongString";
+  private static final Comparator<SerializablePairLongString> COMPARATOR = 
(o1, o2) -> {
+    int comparation;
+
+    // First we check if the objects are null
+    if (o1 == null && o2 == null) {
+      comparation = 0;
+    } else if (o1 == null) {
+      comparation = -1;
+    } else if (o2 == null) {
+      comparation = 1;
+    } else {

Review Comment:
   nit, should we just wrap this comparator in `Comparator.nullsFirst` so that 
this part only has to deal with non-null pairs?



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