vvysotskyi commented on a change in pull request #552: [CALCITE-2018] Queries
failed with AssertionError: rel has lower cost…
URL: https://github.com/apache/calcite/pull/552#discussion_r321978916
##########
File path: core/src/main/java/org/apache/calcite/plan/volcano/RelSet.java
##########
@@ -335,6 +340,18 @@ void mergeWith(
// Has another set merged with this?
assert equivalentSet == null;
+ // calls propagateCostImprovements() for RelSubset instances,
+ // whose best should be changed to checks whether that
+ // subset's parents have gotten cheaper.
+ final Set<RelSubset> activeSet = new HashSet<>();
+ for (Map.Entry<RelSubset, RelNode> subsetBestPair :
changedSubsets.entrySet()) {
+ RelSubset relSubset = subsetBestPair.getKey();
+ relSubset.propagateCostImprovements(
+ planner, mq, subsetBestPair.getValue(),
+ activeSet);
Review comment:
It is required for the case when this `RelSet` contains `RelSubset` which
matches to the trait sets of `otherSubset`, so best may be changed
(`otherSubset.bestCost.isLt(subset.bestCost)` check) and therefore parent rel
nodes should be updated.
----------------------------------------------------------------
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