xiaohui-sun commented on a change in pull request #4565: [TE] Merger fix to 
consider anomalies generated earlier
URL: https://github.com/apache/incubator-pinot/pull/4565#discussion_r317842686
 
 

 ##########
 File path: 
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/algorithm/MergeWrapper.java
 ##########
 @@ -63,10 +63,14 @@
   protected static final Comparator<MergedAnomalyResultDTO> COMPARATOR = new 
Comparator<MergedAnomalyResultDTO>() {
     @Override
     public int compare(MergedAnomalyResultDTO o1, MergedAnomalyResultDTO o2) {
-      // earlier
+      // earlier for start time
       int res = Long.compare(o1.getStartTime(), o2.getStartTime());
       if (res != 0) return res;
 
+      // later for end time
+      res = Long.compare(o2.getStartTime(), o1.getStartTime());
 
 Review comment:
   Good catch! fixed it.

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