[opt](Nereids): GroupExpressionMatching don't need withGroupExpression (#24684)

This commit is contained in:
jakevin
2023-09-21 12:51:44 +08:00
committed by GitHub
parent 7efaf9d0c8
commit bcf1806864
4 changed files with 3 additions and 8 deletions

View File

@ -110,7 +110,7 @@ public class UnboundOlapTableSink<CHILD_TYPE extends Plan> extends LogicalSink<C
public Plan withChildren(List<Plan> children) {
Preconditions.checkArgument(children.size() == 1, "UnboundOlapTableSink only accepts one child");
return new UnboundOlapTableSink<>(nameParts, colNames, hints, partitions, isPartialUpdate,
isFromNativeInsertStmt, groupExpression, Optional.of(getLogicalProperties()), children.get(0));
isFromNativeInsertStmt, groupExpression, Optional.empty(), children.get(0));
}
@Override

View File

@ -52,7 +52,7 @@ public class UnboundResultSink<CHILD_TYPE extends Plan> extends LogicalSink<CHIL
@Override
public Plan withChildren(List<Plan> children) {
Preconditions.checkArgument(children.size() == 1, "UnboundResultSink only accepts one child");
return new UnboundResultSink<>(groupExpression, Optional.of(getLogicalProperties()), children.get(0));
return new UnboundResultSink<>(groupExpression, Optional.empty(), children.get(0));
}
@Override

View File

@ -257,11 +257,6 @@ public class GroupExpression {
this.requestPropertiesMap.put(requiredProperties, outputProperties);
}
public void putOutputPropertiesMapIfAbsent(PhysicalProperties outputProperties,
PhysicalProperties requiredProperties) {
this.requestPropertiesMap.putIfAbsent(requiredProperties, outputProperties);
}
/**
* Merge GroupExpression.
*/

View File

@ -98,7 +98,7 @@ public class GroupExpressionMatching implements Iterable<Plan> {
if (pattern.matchPredicates(root)) {
// if no children pattern, we treat all children as GROUP. e.g. Pattern.ANY.
// leaf plan will enter this branch too, e.g. logicalRelation().
results.add(root.withGroupExpression(Optional.of(groupExpression)));
results.add(root);
}
} else if (childrenGroupArity > 0) {
// matching children group, one List<Plan> per child