This is an automated email from the ASF dual-hosted git repository.
caogaofei pushed a commit to branch
fix_project_order_in_TableDistributedPlanGenerator
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to
refs/heads/fix_project_order_in_TableDistributedPlanGenerator by this push:
new 3d7dc740a50 fix order of project
3d7dc740a50 is described below
commit 3d7dc740a50182408874697c683c615d588e7be0
Author: Beyyes <[email protected]>
AuthorDate: Wed Apr 2 16:12:00 2025 +0800
fix order of project
---
.../distribute/TableDistributedPlanGenerator.java | 40 ----------------------
1 file changed, 40 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableDistributedPlanGenerator.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableDistributedPlanGenerator.java
index 5ddaec06dbb..c906c011e08 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableDistributedPlanGenerator.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableDistributedPlanGenerator.java
@@ -221,46 +221,6 @@ public class TableDistributedPlanGenerator
@Override
public List<PlanNode> visitProject(ProjectNode node, PlanContext context) {
- List<PlanNode> childrenNodes = node.getChild().accept(this, context);
- OrderingScheme childOrdering =
nodeOrderingMap.get(childrenNodes.get(0).getPlanNodeId());
- if (childOrdering != null) {
- nodeOrderingMap.put(node.getPlanNodeId(), childOrdering);
- }
-
- if (childrenNodes.size() == 1) {
- node.setChild(childrenNodes.get(0));
- return Collections.singletonList(node);
- }
-
- boolean canCopyThis = true;
- if (childOrdering != null) {
- // the column used for order by has been pruned, we can't copy this node
to sub nodeTrees.
- canCopyThis =
-
ImmutableSet.copyOf(node.getOutputSymbols()).containsAll(childOrdering.getOrderBy());
- }
- canCopyThis =
- canCopyThis
- && node.getAssignments().getMap().values().stream()
- .noneMatch(PushPredicateIntoTableScan::containsDiffFunction);
-
- if (!canCopyThis) {
- node.setChild(mergeChildrenViaCollectOrMergeSort(childOrdering,
childrenNodes));
- return Collections.singletonList(node);
- }
-
- List<PlanNode> resultNodeList = new ArrayList<>();
- for (int i = 0; i < childrenNodes.size(); i++) {
- PlanNode child = childrenNodes.get(i);
- ProjectNode subProjectNode =
- new ProjectNode(queryId.genPlanNodeId(), child,
node.getAssignments());
- resultNodeList.add(subProjectNode);
- nodeOrderingMap.put(subProjectNode.getPlanNodeId(), childOrdering);
- }
- return resultNodeList;
- }
-
- // @Override
- public List<PlanNode> visitProject2(ProjectNode node, PlanContext context) {
List<PlanNode> childrenNodes = node.getChild().accept(this, context);
OrderingScheme childOrdering =
nodeOrderingMap.get(childrenNodes.get(0).getPlanNodeId());
boolean containAllSortItem = false;