surekhasaharan commented on a change in pull request #7624: Fix 
resultLevelCache for timeseries with grandTotal
URL: https://github.com/apache/incubator-druid/pull/7624#discussion_r282627984
 
 

 ##########
 File path: processing/src/main/java/org/apache/druid/query/Result.java
 ##########
 @@ -51,10 +54,20 @@ public Result(@JsonProperty("timestamp") DateTime 
timestamp, @JsonProperty("resu
   @Override
   public int compareTo(Result<T> tResult)
   {
-    return timestamp.compareTo(tResult.timestamp);
+    // timestamp is null for grandTotal which should come last.
+    if (timestamp == null && tResult.timestamp == null) {
+      return 0;
+    } else if (timestamp == null) {
+      return 1;
+    } else if (tResult == null) {
+      return -1;
 
 Review comment:
   and this should be 1 ? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to