danny0405 commented on a change in pull request #1440: [CALCITE-2166]
Cumulative cost of RelSubset.best RelNode is increased…
URL: https://github.com/apache/calcite/pull/1440#discussion_r321988009
##########
File path:
core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
##########
@@ -883,10 +883,21 @@ protected boolean isValid(Litmus litmus) {
subset.getDescription(), set);
}
- // Make sure best RelNode is valid
- if (subset.best != null && !subset.set.rels.contains(subset.best)) {
- return litmus.fail("RelSubset [{}] does not contain its best RelNode
[{}]",
- subset.getDescription(), subset.best.getDescription());
+ if (subset.best != null) {
+
+ // Make sure best RelNode is valid
+ if (!subset.set.rels.contains(subset.best)) {
+ return litmus.fail("RelSubset [{}] does not contain its best
RelNode [{}]",
+ subset.getDescription(), subset.best.getDescription());
+ }
+
+ // Make sure bsetCost is accurate
+ RelOptCost bestCost = getCost(subset.best,
subset.best.getCluster().getMetadataQuery());
Review comment:
should be bestCost
----------------------------------------------------------------
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]
With regards,
Apache Git Services