You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ji...@apache.org on 2020/08/14 17:50:54 UTC

[incubator-pinot] 01/01: [TE] anomaly search - hide child anomaly unless queried with anomaly ids

This is an automated email from the ASF dual-hosted git repository.

jihao pushed a commit to branch anomaly-searcher-child
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit d173efe30472153fe7d65c52c86926a077ea765f
Author: Jihao Zhang <ji...@linkedin.com>
AuthorDate: Fri Aug 14 10:50:22 2020 -0700

    [TE] anomaly search - hide child anomaly unless queried with anomaly ids
---
 .../thirdeye/dashboard/resources/v2/anomalies/AnomalySearcher.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/anomalies/AnomalySearcher.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/anomalies/AnomalySearcher.java
index eeacbad..0403a97 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/anomalies/AnomalySearcher.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/anomalies/AnomalySearcher.java
@@ -70,7 +70,11 @@ public class AnomalySearcher {
    * @return the result
    */
   public Map<String, Object> search(AnomalySearchFilter searchFilter, int limit, int offset) {
-    Predicate predicate = Predicate.EQ("child", false);
+    Predicate predicate = Predicate.NEQ("baseId", 0);
+    // hide child anomaly unless queried with ids
+    if (searchFilter.getAnomalyIds().isEmpty()) {
+      predicate = Predicate.EQ("child", false);
+    }
     if (searchFilter.getStartTime() != null) {
       predicate = Predicate.AND(predicate, Predicate.LT("startTime", searchFilter.getEndTime()));
     }
@@ -152,5 +156,4 @@ public class AnomalySearcher {
     }
     return ImmutableMap.of("count", count, "limit", limit, "offset", offset, "elements", results);
   }
-
 }


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