morrySnow commented on code in PR #12147:
URL: https://github.com/apache/doris/pull/12147#discussion_r957385006
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/memo/GroupExpression.java:
##########
@@ -181,13 +208,14 @@ public boolean equals(Object o) {
return false;
}
GroupExpression that = (GroupExpression) o;
- // if the plan is LogicalRelation or PhysicalRelation, this == that
should be true,
+ // if the plan is UnboundRelation or LogicalRelation or
PhysicalRelation, this == that should be true,
// when if one relation appear in plan more than once,
// we cannot distinguish them throw equals function, since equals
function cannot use output info.
- if (plan instanceof LogicalRelation || plan instanceof
PhysicalRelation) {
+ if (plan instanceof UnboundRelation || plan instanceof LogicalRelation
|| plan instanceof PhysicalRelation) {
return false;
}
- return children.equals(that.children) && plan.equals(that.plan);
+ return children.equals(that.children) && plan.equals(that.plan)
+ &&
plan.getLogicalProperties().equals(that.plan.getLogicalProperties());
Review Comment:
yes, what i mean is we can remove that code and use equals directly. the
case i met recently is, when we do partition prune, we need to update select
partition list in LogicalOlapScan, and then when we copy in the new Scan, we
cannot get the correct existed GroupExpression because the object is aways new.
To avoid that, we have to add a new attribute named 'isPartitionPruned' to do
the judgement in LogicalOlapScan and it is ugly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]