hsyuan commented on a change in pull request #1949:
URL: https://github.com/apache/calcite/pull/1949#discussion_r416216541
##########
File path:
core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
##########
@@ -940,11 +941,24 @@ void reregister(
assert equivRel.getClass() == rel.getClass();
assert equivRel.getTraitSet().equals(rel.getTraitSet());
+ mergeIdenticalRels(equivRel, rel);
return;
}
// Add the relational expression into the correct set and subset.
- addRelToSet(rel, set);
+ if (!prunedNodes.contains(rel)) {
+ addRelToSet(rel, set);
+ }
+ }
+
+ /**
+ * Update relNode related information when two identical relNodes are
+ * de-duped.
+ */
+ private void mergeIdenticalRels(RelNode to, RelNode from) {
Review comment:
from, to is confusing. Can we use equivRel, rel instead? And the comment
doesn't elaborate what does it do.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]