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/05/16 15:58:24 UTC

[GitHub] [iotdb] liuminghui233 commented on a diff in pull request #5846: [IOTDB-2844] Implementaion of AggregationOperator and RawDataAggregationOperator

liuminghui233 commented on code in PR #5846:
URL: https://github.com/apache/iotdb/pull/5846#discussion_r873897305


##########
server/src/main/java/org/apache/iotdb/db/query/expression/Expression.java:
##########
@@ -70,7 +70,7 @@
 public abstract class Expression {
 
   /////////////////////////////////////////////////////////////////////////////////////////////////
-  // Expression type inferring for execution plan generation
+  // Expression type inferring for execution plan generation //////////////////////////////////////

Review Comment:
   useless change



##########
server/src/main/java/org/apache/iotdb/db/mpp/execution/schedule/DriverScheduler.java:
##########
@@ -66,7 +66,7 @@ public static DriverScheduler getInstance() {
 
   private static final int MAX_CAPACITY = 1000; // TODO: load from config files
   private static final int WORKER_THREAD_NUM = 4; // TODO: load from config files
-  private static final int QUERY_TIMEOUT_MS = 10_000; // TODO: load from config files or requests
+  private static final int QUERY_TIMEOUT_MS = 1000_000; // TODO: load from config files or requests

Review Comment:
   Is this a temporary value for debug ?



##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LocalExecutionPlanner.java:
##########
@@ -530,7 +536,64 @@ public Operator visitOffset(OffsetNode node, LocalExecutionPlanContext context)
     @Override
     public Operator visitRowBasedSeriesAggregate(
         AggregationNode node, LocalExecutionPlanContext context) {
-      return super.visitRowBasedSeriesAggregate(node, context);
+      checkArgument(
+          node.getAggregationDescriptorList().size() >= 1,
+          "Aggregation descriptorList cannot be empty");
+      OperatorContext operatorContext =
+          context.instanceContext.addOperatorContext(
+              context.getNextOperatorId(),
+              node.getPlanNodeId(),
+              DeviceViewNode.class.getSimpleName());
+      List<Operator> children =
+          node.getChildren().stream()
+              .map(child -> child.accept(this, context))
+              .collect(Collectors.toList());
+      boolean ascending = node.getScanOrder() == OrderBy.TIMESTAMP_ASC;
+      List<Aggregator> aggregators = new ArrayList<>();
+      Map<String, List<InputLocation>> layout = makeLayout(node);
+      for (AggregationDescriptor descriptor : node.getAggregationDescriptorList()) {
+        List<String> outputColumnNames = descriptor.getOutputColumnNames();
+        // it may include double parts
+        List<List<InputLocation>> inputLocationParts = new ArrayList<>(outputColumnNames.size());
+        outputColumnNames.forEach(o -> inputLocationParts.add(layout.get(o)));
+
+        List<InputLocation[]> inputLocationList = new ArrayList<>();
+        for (int i = 0; i < inputLocationParts.get(0).size(); i++) {
+          if (outputColumnNames.size() == 1) {
+            inputLocationList.add(new InputLocation[] {inputLocationParts.get(0).get(i)});
+          } else {
+            inputLocationList.add(
+                new InputLocation[] {
+                  inputLocationParts.get(0).get(i), inputLocationParts.get(1).get(i)
+                });
+          }
+        }
+
+        // TODO type here may be incorrect

Review Comment:
   why?



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