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 2021/09/14 05:21:21 UTC

[GitHub] [iotdb] HTHou commented on a change in pull request #3953: [To rel/0.12][ISSUE-3945] Fuzzy query support multiDevices and alignByDevice Dataset

HTHou commented on a change in pull request #3953:
URL: https://github.com/apache/iotdb/pull/3953#discussion_r707918823



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ConcatPathOptimizer.java
##########
@@ -292,23 +294,39 @@ private FilterOperator constructBinaryFilterTreeWithAnd(
         currentNode.addChildOperator(newInnerNode);
         currentNode = newInnerNode;
       }
-      try {
-        if (operator instanceof InOperator) {
+      switch (operator.getType()) {
+        case IN:
           currentNode.addChildOperator(
               new InOperator(
                   operator.getTokenIntType(),
                   noStarPaths.get(i),
                   ((InOperator) operator).getNot(),
                   ((InOperator) operator).getValues()));
-        } else {
+          break;
+        case LIKE:
           currentNode.addChildOperator(
-              new BasicFunctionOperator(
+              new LikeOperator(
                   operator.getTokenIntType(),
                   noStarPaths.get(i),
-                  ((BasicFunctionOperator) operator).getValue()));
-        }
-      } catch (SQLParserException e) {
-        throw new LogicalOptimizeException(e.getMessage());
+                  ((LikeOperator) operator).getValue()));
+          break;
+        case REGEXP:
+          currentNode.addChildOperator(
+              new RegexpOperator(
+                  operator.getTokenIntType(),
+                  noStarPaths.get(i),
+                  ((RegexpOperator) operator).getValue()));
+          break;
+        default:
+          try {
+            currentNode.addChildOperator(
+                new BasicFunctionOperator(
+                    operator.getTokenIntType(),
+                    noStarPaths.get(i),
+                    ((BasicFunctionOperator) operator).getValue()));
+          } catch (SQLParserException e) {
+            throw new LogicalOptimizeException(e.getMessage());
+          }
       }

Review comment:
       Hi, is it OK to try catch SQLParserException for BasicFunctionOperator only?




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

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org