You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/05/09 07:38:41 UTC

[GitHub] [calcite] chunweilei commented on a change in pull request #1966: [CALCITE-3981] Volcano.register should not return stale/merged subset

chunweilei commented on a change in pull request #1966:
URL: https://github.com/apache/calcite/pull/1966#discussion_r422464778



##########
File path: core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
##########
@@ -717,9 +718,10 @@ public RelOptCost getCost(RelNode rel, RelMetadataQuery mq) {
   public RelSubset getSubset(RelNode rel) {
     assert rel != null : "pre: rel != null";
     if (rel instanceof RelSubset) {
-      return (RelSubset) rel;
+      return canonize((RelSubset) rel);
     } else {
-      return mapRel2Subset.get(rel);
+      RelSubset s = mapRel2Subset.get(rel);
+      return s == null ? null : canonize(s);
     }

Review comment:
       I am wondering if we can add some tests. Maybe it is diffcult. 




----------------------------------------------------------------
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:
users@infra.apache.org