You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2019/12/28 03:13:15 UTC

[GitHub] [incubator-iotdb] jt2594838 commented on a change in pull request #687: Add value filter function while executing group by device

jt2594838 commented on a change in pull request #687: Add value filter function while executing group by device
URL: https://github.com/apache/incubator-iotdb/pull/687#discussion_r361771827
 
 

 ##########
 File path: server/src/main/java/org/apache/iotdb/db/qp/logical/crud/FilterOperator.java
 ##########
 @@ -208,8 +208,19 @@ public boolean equals(Object fil) {
     if (!(fil instanceof FilterOperator)) {
       return false;
     }
+    // if child is leaf, will execute BasicFunctionOperator.equals()
     FilterOperator operator = (FilterOperator) fil;
-    return compareTo(operator) == 0;
+    if(this.tokenIntType == operator.tokenIntType){
+      if(this.getChildren().size() == operator.getChildren().size()){
+          for(int i = 0; i < this.getChildren().size(); i++){
+            if(!this.getChildren().get(i).equals(operator.getChildren().get(i))){
+              return false;
+            }
+          }
+          return true;
+      }
+    }
+    return false;
 
 Review comment:
   Maybe
   ```
   return this.tokenIntType == operator.tokenIntType && this.getChildren().equals(operator.getChildren());
   ```
   is just enough?

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