This is an automated email from the ASF dual-hosted git repository.
jakevin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 3745e6c18a [fix](Nereids): order of project's logical properties is
different with that of project expression (#17648)
3745e6c18a is described below
commit 3745e6c18a4bf19ab155c0fb0ac196cf43e55f33
Author: 谢健 <[email protected]>
AuthorDate: Sat Mar 11 00:26:54 2023 +0800
[fix](Nereids): order of project's logical properties is different with
that of project expression (#17648)
---
.../doris/nereids/glue/translator/PhysicalPlanTranslator.java | 5 ++++-
.../java/org/apache/doris/nereids/jobs/cascades/ApplyRuleJob.java | 1 +
.../main/java/org/apache/doris/nereids/memo/GroupExpression.java | 7 +++++++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java
index 4c137e4732..a05c5c94bf 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java
@@ -1361,7 +1361,10 @@ public class PhysicalPlanTranslator extends
DefaultPlanVisitor<PlanFragment, Pla
// TODO: fix the project alias of an aliased relation.
PlanNode inputPlanNode = inputFragment.getPlanRoot();
- List<Slot> slotList = project.getOutput();
+ List<Slot> slotList = project.getProjects()
+ .stream()
+ .map(e -> e.toSlot())
+ .collect(Collectors.toList());
// For hash join node, use vSrcToOutputSMap to describe the expression
calculation, use
// vIntermediateTupleDescList as input, and set vOutputTupleDesc as
the final output.
// TODO: HashJoinNode's be implementation is not support projection
yet, remove this after when supported.
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/ApplyRuleJob.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/ApplyRuleJob.java
index 1f653b22f4..d3e6031e3f 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/ApplyRuleJob.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/cascades/ApplyRuleJob.java
@@ -76,6 +76,7 @@ public class ApplyRuleJob extends Job {
continue;
}
GroupExpression newGroupExpression =
result.correspondingExpression;
+ newGroupExpression.setFromRule(rule);
if (newPlan instanceof LogicalPlan) {
pushJob(new OptimizeGroupExpressionJob(newGroupExpression,
context));
} else {
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/memo/GroupExpression.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/memo/GroupExpression.java
index 4555935f25..370fabaf0e 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/memo/GroupExpression.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/memo/GroupExpression.java
@@ -56,6 +56,9 @@ public class GroupExpression {
private long estOutputRowCount = -1;
+ //Record the rule that generate this plan. It's used for debugging
+ private Rule fromRule;
+
// Mapping from output properties to the corresponding best cost,
statistics, and child properties.
// key is the physical properties the group expression support for its
parent
// and value is cost and request physical properties to its children.
@@ -99,6 +102,10 @@ public class GroupExpression {
return children.size();
}
+ public void setFromRule(Rule rule) {
+ this.fromRule = rule;
+ }
+
public Group getOwnerGroup() {
return ownerGroup;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]