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/13 06:36:45 UTC

[GitHub] [iotdb] ijihang opened a new pull request #3953: [To rel/0.12][ISSUE-3945]support multiDevices and alignByDevice Dataset

ijihang opened a new pull request #3953:
URL: https://github.com/apache/iotdb/pull/3953


   ## Description
   Fuzzy query support multiDevice and alignByDevice
   
   <hr>
   This PR has:
   - [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold 
     for code coverage.
   - [x] added integration tests.
   <hr>
   


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



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

Posted by GitBox <gi...@apache.org>.
HTHou commented on pull request #3953:
URL: https://github.com/apache/iotdb/pull/3953#issuecomment-918883143


   Please don't forget to submit a PR to master.


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



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

Posted by GitBox <gi...@apache.org>.
ijihang commented on a change in pull request #3953:
URL: https://github.com/apache/iotdb/pull/3953#discussion_r707945014



##########
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:
       Other Operators are created without exceptions, the default is BasicFunctionOperator may have exceptions




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



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

Posted by GitBox <gi...@apache.org>.
HTHou merged pull request #3953:
URL: https://github.com/apache/iotdb/pull/3953


   


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



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

Posted by GitBox <gi...@apache.org>.
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