jihaozh commented on a change in pull request #5626:
URL: https://github.com/apache/incubator-pinot/pull/5626#discussion_r447299598



##########
File path: 
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/dashboard/resources/v2/alerts/AlertSearcher.java
##########
@@ -194,15 +194,23 @@ public AlertSearcher() {
     Set<Long> metricIds = new HashSet<>();
     if (!searchFilter.getMetrics().isEmpty()) {
       for (String metric : searchFilter.getMetrics()) {
-        metricIds =
-            
this.metricDAO.findByMetricName(metric).stream().map(AbstractDTO::getId).collect(Collectors.toSet());
+        metricIds.addAll(
+            
this.metricDAO.findByMetricName(metric).stream().map(AbstractDTO::getId).collect(Collectors.toSet()));
       }
     }
 
     if (!searchFilter.getDatasets().isEmpty()) {
+      Set<Long> metricIdsFromDataset = new HashSet<>();
       for (String dataset : searchFilter.getDatasets()) {
-        metricIds.retainAll(
-            
this.metricDAO.findByDataset(dataset).stream().map(AbstractDTO::getId).collect(Collectors.toSet()));
+        
metricIdsFromDataset.addAll(this.metricDAO.findByPredicate(Predicate.LIKE("dataset",
 "%" + dataset + "%"))

Review comment:
       sure. added the comments




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



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

Reply via email to