xndai 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_r322081042
##########
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:
Thanks. Now I see why. It looks to me that if we move these codes to be
after line 363 (renaming parentRel), then we won't need line 373 to line 378.
What do you think?
----------------------------------------------------------------
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