akshayrai commented on a change in pull request #4377: [TE] support entity 
group expression
URL: https://github.com/apache/incubator-pinot/pull/4377#discussion_r298778064
 
 

 ##########
 File path: 
thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/components/TriggerConditionGrouper.java
 ##########
 @@ -165,30 +166,17 @@
     }
   }
 
-  /**
-   * Groups the anomalies based on the operator string expression
-   */
-  private List<MergedAnomalyResultDTO> groupAnomaliesByExpression(String 
expression, List<MergedAnomalyResultDTO> anomalies) {
-    groupAnomaliesByOperator(buildOperatorTree(expression), anomalies);
-    return anomalies;
-  }
-
-  // TODO: Build parse tree from string expression and execute
-  private Map<String, Object> buildOperatorTree(String expression) {
-    return new HashMap<>();
-  }
-
   @Override
   public List<MergedAnomalyResultDTO> group(List<MergedAnomalyResultDTO> 
anomalies) {
+    Map<String, Object> operatorTreeRoot = new HashMap<>();
     if (operator != null) {
-      Map<String, Object> operatorTreeRoot = new HashMap<>();
       operatorTreeRoot.put(PROP_OPERATOR, operator);
       operatorTreeRoot.put(PROP_LEFT_OP, leftOp);
       operatorTreeRoot.put(PROP_RIGHT_OP, rightOp);
-      return groupAnomaliesByOperator(operatorTreeRoot, anomalies);
     } else {
-      return groupAnomaliesByExpression(expression, anomalies);
+      operatorTreeRoot = generateOperators(expression);
 
 Review comment:
   include try-catch for parsing expression

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