You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/03/30 23:50:12 UTC

[GitHub] [incubator-pinot] xiaohui-sun commented on a change in pull request #5196: [TE] fix the merger issue that it can't merge historical anomaly generated by multiple rules

xiaohui-sun commented on a change in pull request #5196: [TE] fix the merger issue that it can't merge historical anomaly generated by multiple rules
URL: https://github.com/apache/incubator-pinot/pull/5196#discussion_r400561252
 
 

 ##########
 File path: thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/wrapper/ChildKeepingMergeWrapper.java
 ##########
 @@ -48,9 +50,23 @@ public ChildKeepingMergeWrapper(DataProvider provider, DetectionConfigDTO config
   }
 
   @Override
-  // does not fetch any anomalies from database
+  // retrieve the anomalies that are detected by multiple detectors
   protected List<MergedAnomalyResultDTO> retrieveAnomaliesFromDatabase(List<MergedAnomalyResultDTO> generated) {
-    return Collections.emptyList();
+    AnomalySlice effectiveSlice = this.slice.withDetectionId(this.config.getId())
+        .withStart(this.getStartTime(generated) - this.maxGap - 1)
+        .withEnd(this.getEndTime(generated) + this.maxGap + 1);
+
+    Collection<MergedAnomalyResultDTO> anomalies =
+        this.provider.fetchAnomalies(Collections.singleton(effectiveSlice)).get(effectiveSlice);
+
+    return anomalies.stream()
+        .filter(anomaly -> !anomaly.isChild() && isDetectedByMultipleComponents(anomaly))
 
 Review comment:
   Why we need to have a filter on multiple component here?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org