You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2022/05/27 13:32:40 UTC
[iotdb] 07/07: fix some issues
This is an automated email from the ASF dual-hosted git repository.
xingtanzjr pushed a commit to branch xingtanzjr/align_by_device_distribution
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit dff17f87b56c6ab9c9472ee179e40c828f3e9a52
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Fri May 27 21:32:20 2022 +0800
fix some issues
---
.../db/mpp/plan/planner/LocalExecutionPlanner.java | 35 +++++++++-------------
1 file changed, 14 insertions(+), 21 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LocalExecutionPlanner.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LocalExecutionPlanner.java
index 08040f0d06..1b7b78b44e 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LocalExecutionPlanner.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LocalExecutionPlanner.java
@@ -231,7 +231,9 @@ public class LocalExecutionPlanner {
return new SchemaDriver(root, context.getSinkHandle(), schemaDriverContext);
}
- /** This Visitor is responsible for transferring PlanNode Tree to Operator Tree */
+ /**
+ * This Visitor is responsible for transferring PlanNode Tree to Operator Tree
+ */
private static class Visitor extends PlanVisitor<Operator, LocalExecutionPlanContext> {
@Override
@@ -323,7 +325,7 @@ public class LocalExecutionPlanner {
descriptor.getAggregationType(), seriesDataType, ascending),
descriptor.getStep(),
Collections.singletonList(
- new InputLocation[] {new InputLocation(0, seriesIndex)})));
+ new InputLocation[]{new InputLocation(0, seriesIndex)})));
}
AlignedSeriesAggregationScanOperator seriesAggregationScanOperator =
@@ -798,21 +800,10 @@ public class LocalExecutionPlanner {
Map<String, List<InputLocation>> layout = makeLayout(node);
for (GroupByLevelDescriptor descriptor : node.getGroupByLevelDescriptors()) {
List<String> inputColumnNames = descriptor.getInputColumnNames();
- // it may include double parts
- List<List<InputLocation>> inputLocationParts = new ArrayList<>(inputColumnNames.size());
- inputColumnNames.forEach(o -> inputLocationParts.add(layout.get(o)));
-
- List<InputLocation[]> inputLocationList = new ArrayList<>();
- for (int i = 0; i < inputLocationParts.get(0).size(); i++) {
- if (inputColumnNames.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)
- });
- }
- }
+ List<InputLocation[]> inputLocationList = new ArrayList<>(inputColumnNames.size());
+ inputColumnNames.forEach(
+ inputColumnName ->
+ inputLocationList.add(layout.get(inputColumnName).toArray(new InputLocation[0])));
aggregators.add(
new Aggregator(
@@ -835,6 +826,7 @@ public class LocalExecutionPlanner {
operatorContext, aggregators, children, ascending, node.getGroupByTimeParameter());
}
+
@Override
public Operator visitSlidingWindowAggregation(
SlidingWindowAggregationNode node, LocalExecutionPlanContext context) {
@@ -953,11 +945,11 @@ public class LocalExecutionPlanner {
List<InputLocation[]> inputLocationList = new ArrayList<>();
for (int i = 0; i < inputLocationParts.get(0).size(); i++) {
if (inputColumnNames.size() == 1) {
- inputLocationList.add(new InputLocation[] {inputLocationParts.get(0).get(i)});
+ inputLocationList.add(new InputLocation[]{inputLocationParts.get(0).get(i)});
} else {
inputLocationList.add(
- new InputLocation[] {
- inputLocationParts.get(0).get(i), inputLocationParts.get(1).get(i)
+ new InputLocation[]{
+ inputLocationParts.get(0).get(i), inputLocationParts.get(1).get(i)
});
}
}
@@ -1317,7 +1309,8 @@ public class LocalExecutionPlanner {
private static class InstanceHolder {
- private InstanceHolder() {}
+ private InstanceHolder() {
+ }
private static final LocalExecutionPlanner INSTANCE = new LocalExecutionPlanner();
}