You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ca...@apache.org on 2023/09/27 06:24:04 UTC
[iotdb] branch beyyes/fix_last_order created (now d1467ce6f52)
This is an automated email from the ASF dual-hosted git repository.
caogaofei pushed a change to branch beyyes/fix_last_order
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at d1467ce6f52 fix the data scan ordering when executing last query
This branch includes the following new commits:
new d1467ce6f52 fix the data scan ordering when executing last query
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 the data scan ordering when executing last query
Posted by ca...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
caogaofei pushed a commit to branch beyyes/fix_last_order
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit d1467ce6f52a46ad4158928f301a6d8e470a8b8d
Author: Beyyes <cg...@foxmail.com>
AuthorDate: Wed Sep 27 14:20:45 2023 +0800
fix the data scan ordering when executing last query
---
.../iotdb/db/queryengine/plan/planner/LogicalPlanBuilder.java | 8 ++++----
.../iotdb/db/queryengine/plan/planner/LogicalPlanVisitor.java | 4 +---
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/LogicalPlanBuilder.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/LogicalPlanBuilder.java
index 3468cf3b81e..1a10a776514 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/LogicalPlanBuilder.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/LogicalPlanBuilder.java
@@ -223,7 +223,7 @@ public class LogicalPlanBuilder {
}
public LogicalPlanBuilder planLast(
- Analysis analysis, Ordering timeseriesOrdering, Ordering resultTimeOrder, ZoneId zoneId) {
+ Analysis analysis, Ordering timeseriesOrdering, ZoneId zoneId) {
Set<String> deviceAlignedSet = new HashSet<>();
Set<String> deviceExistViewSet = new HashSet<>();
// <Device, <Measurement, Expression>>
@@ -330,11 +330,11 @@ public class LogicalPlanBuilder {
planBuilder
.planRawDataSource(
sources,
- resultTimeOrder,
+ Ordering.DESC,
analysis.getGlobalTimeFilter(),
analysis.isLastLevelUseWildcard())
.planWhereAndSourceTransform(
- null, sourceTransformExpressions, false, zoneId, resultTimeOrder)
+ null, sourceTransformExpressions, false, zoneId, Ordering.DESC)
.planAggregation(
new LinkedHashSet<>(Arrays.asList(maxTimeAgg, lastValueAgg)),
null,
@@ -342,7 +342,7 @@ public class LogicalPlanBuilder {
analysis.getGroupByParameter(),
false,
AggregationStep.SINGLE,
- resultTimeOrder);
+ Ordering.DESC);
LastQueryTransformNode transformNode =
new LastQueryTransformNode(
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/LogicalPlanVisitor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/LogicalPlanVisitor.java
index 7472147ec98..83ba02a2801 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/LogicalPlanVisitor.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/LogicalPlanVisitor.java
@@ -104,7 +104,6 @@ import java.util.Map;
import java.util.Objects;
import java.util.Set;
-import static org.apache.iotdb.db.queryengine.plan.statement.component.Ordering.ASC;
import static org.apache.iotdb.db.utils.constant.SqlConstant.COUNT_TIME;
/**
@@ -135,7 +134,6 @@ public class LogicalPlanVisitor extends StatementVisitor<PlanNode, MPPQueryConte
.planLast(
analysis,
analysis.getTimeseriesOrderingForLastQuery(),
- queryStatement.getResultTimeOrder(),
queryStatement.getSelectComponent().getZoneId())
.planOffset(queryStatement.getRowOffset())
.planLimit(queryStatement.getRowLimit());
@@ -623,7 +621,7 @@ public class LogicalPlanVisitor extends StatementVisitor<PlanNode, MPPQueryConte
&& 0 != analysis.getDataPartitionInfo().getDataPartitionMap().size()) {
PlanNode lastPlanNode =
new LogicalPlanBuilder(analysis, context)
- .planLast(analysis, null, ASC, ZoneId.systemDefault())
+ .planLast(analysis, null, ZoneId.systemDefault())
.getRoot();
planBuilder = planBuilder.planSchemaQueryOrderByHeat(lastPlanNode);
}