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 2022/03/28 17:01:35 UTC

[GitHub] [iotdb] xingtanzjr opened a new pull request #5364: Connect the Query Plan stage from SQL to DistributionPlan with UT and mock interfaces

xingtanzjr opened a new pull request #5364:
URL: https://github.com/apache/iotdb/pull/5364


   ## Description
   
   * Polish the PlanNode and supply unimplemented method for some PlanNode.
   * Add a method to print the PlanNode tree in a more friendly way
   * Prepare a UT to represent the stage from SQL to DistributedPlan. See the following snapshot.
   <img width="1239" alt="image" src="https://user-images.githubusercontent.com/18027703/160449822-167a2185-8058-41a3-a6f6-c8e6d844b9a0.png">
   <img width="1220" alt="image" src="https://user-images.githubusercontent.com/18027703/160449850-1d14f120-5c9c-433b-b9e6-0b1fb684a359.png">
   
   


-- 
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] liuminghui233 commented on a change in pull request #5364: Connect the Query Plan stage from SQL to DistributionPlan with UT and mock interfaces

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



##########
File path: server/src/main/java/org/apache/iotdb/db/mpp/common/schematree/SchemaTree.java
##########
@@ -36,12 +39,47 @@
   /**
    * Return all measurement paths for given path pattern and filter the result by slimit and offset.
    *
-   * @param pathPattern can be a pattern or a full path of timeseries.
+   * @param pathPattern   can be a pattern or a full path of timeseries.
    * @param isPrefixMatch if true, the path pattern is used to match prefix path
    * @return Left: all measurement paths; Right: remaining series offset
    */
   public Pair<List<MeasurementPath>, Integer> searchMeasurementPaths(
       PartialPath pathPattern, int slimit, int soffset, boolean isPrefixMatch) {
+    // TODO: (xingtanzjr) we mock some results here to test the whole procedure
+    try {
+      String[] paths = new String[]{
+          "root.sg.d1.s1",
+          "root.sg.d1.s2",
+          "root.sg.d22.s1",
+          "root.sg.d22.s2",
+          "root.sg.d333.s1",
+          "root.sg.d333.s2",
+      };
+
+      List<MeasurementPath> result = new ArrayList<>();
+      String target = pathPattern.getFullPath();
+      StringBuilder noStar = new StringBuilder();
+      boolean lastCharIsStar = false;
+      for(int i = 0 ; i < target.length(); i ++) {
+        char c = target.charAt(i);
+        if (c == '*' || (lastCharIsStar && c == '.')) {
+          lastCharIsStar = c == '*';
+          continue;
+        }
+        lastCharIsStar = false;
+        noStar.append(String.valueOf(c));
+      }
+
+      for (String path : paths) {
+        if (path.contains(noStar)) {
+          result.add(new MeasurementPath(path));

Review comment:
       ```suggestion
             result.add(new MeasurementPath(path, new MeasurementSchema(path.getMeasurement(), TSDataType.DOUBLE)));
   ```
   It is better to mock the data type as well.




-- 
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] JackieTien97 merged pull request #5364: Connect the Query Plan stage from SQL to DistributionPlan with UT and mock interfaces

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


   


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