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/31 02:45:17 UTC
[iotdb] branch aggregateTestBug created (now 4de6174799)
This is an automated email from the ASF dual-hosted git repository.
xiangweiwei pushed a change to branch aggregateTestBug
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at 4de6174799 fix align by device bug:
This branch includes the following new commits:
new 4de6174799 fix align by device bug:
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[iotdb] 01/01: fix align by device bug:
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiangweiwei pushed a commit to branch aggregateTestBug
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 4de6174799739165b358cbcb41c146ce273b5f10
Author: Alima777 <wx...@gmail.com>
AuthorDate: Tue May 31 10:44:53 2022 +0800
fix align by device bug:
---
.../apache/iotdb/db/mpp/plan/analyze/ExpressionAnalyzer.java | 10 ++++++++--
.../apache/iotdb/db/mpp/plan/planner/LogicalPlanBuilder.java | 6 +++---
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ExpressionAnalyzer.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ExpressionAnalyzer.java
index 0c5cfc5b1d..7c0a6e9a54 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ExpressionAnalyzer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/ExpressionAnalyzer.java
@@ -420,8 +420,11 @@ public class ExpressionAnalyzer {
} else if (expression instanceof FunctionExpression) {
List<List<Expression>> extendedExpressions = new ArrayList<>();
for (Expression suffixExpression : expression.getExpressions()) {
- extendedExpressions.add(
- concatDeviceAndRemoveWildcard(suffixExpression, devicePath, schemaTree, typeProvider));
+ List<Expression> concatedExpression =
+ concatDeviceAndRemoveWildcard(suffixExpression, devicePath, schemaTree, typeProvider);
+ if (concatedExpression != null && concatedExpression.size() != 0) {
+ extendedExpressions.add(concatedExpression);
+ }
}
List<List<Expression>> childExpressionsList = new ArrayList<>();
cartesianProduct(extendedExpressions, childExpressionsList, 0, new ArrayList<>());
@@ -431,6 +434,9 @@ public class ExpressionAnalyzer {
PartialPath concatPath = devicePath.concatPath(measurement);
List<MeasurementPath> actualPaths = schemaTree.searchMeasurementPaths(concatPath).left;
+ if (actualPaths.isEmpty()) {
+ return new ArrayList<>();
+ }
List<PartialPath> noStarPaths = new ArrayList<>(actualPaths);
noStarPaths.forEach(path -> typeProvider.setType(path.getFullPath(), path.getSeriesType()));
return reconstructTimeSeriesOperands(noStarPaths);
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanBuilder.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanBuilder.java
index 15ae9ccc84..332434d89e 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanBuilder.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/LogicalPlanBuilder.java
@@ -83,7 +83,7 @@ import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -176,8 +176,8 @@ public class LogicalPlanBuilder {
List<PlanNode> sourceNodeList = new ArrayList<>();
boolean needCheckAscending = groupByTimeParameter == null;
- Map<PartialPath, List<AggregationDescriptor>> ascendingAggregations = new HashMap<>();
- Map<PartialPath, List<AggregationDescriptor>> descendingAggregations = new HashMap<>();
+ Map<PartialPath, List<AggregationDescriptor>> ascendingAggregations = new LinkedHashMap<>();
+ Map<PartialPath, List<AggregationDescriptor>> descendingAggregations = new LinkedHashMap<>();
for (Expression sourceExpression : sourceExpressions) {
AggregationType aggregationFunction =
AggregationType.valueOf(