[fix](Nereids): order of project's logical properties is different with that of project expression (#17648)

This commit is contained in:
谢健
2023-03-11 00:26:54 +08:00
committed by GitHub
parent 051ab7a9c6
commit 3745e6c18a
3 changed files with 12 additions and 1 deletions

View File

@ -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.

View File

@ -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 {

View File

@ -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;
}