rubenada opened a new pull request, #3185:
URL: https://github.com/apache/calcite/pull/3185

   See problem description in:
   [CALCITE-5401](https://issues.apache.org/jira/browse/CALCITE-5401) Rule 
fired by HepPlanner can return Volcano's RelSubset
   
   Correct the issue via:
   - Add new (default) methods `convert` in `RelOptPlanner` (code taken from 
`RelOptRule#convert`).
   - `RelOptRule#convert` methods will just call `RelOptPlanner#convert`.
   - All calls to `convert` inside a rule's `onMatch` method will have to go 
through `RelOptRuleCall.getPlanner().convert(...)` to ensure that the right 
planner conversion is applied (planner taken from the rule call, not from the 
RelNode cluster).
   
   Notice that 3rd point is the key to avoid this issue, and it aligns the 
`onMatch` with other planner-related methods. For example, right now rules that 
need to call  `RelOptPlanner#prune` inside  `onMatch`  always call 
`call.getPlanner().prune(...)`  (and not 
`relNode.getCluster().getPlanner().prune(...)` ). Similarly, rules calling 
`RelOptPlanner#onCopy` inside `onMatch` do so via 
`call.getPlanner().onCopy(...)`  (and not via 
`relNode.getCluster().getPlanner().onCopy(...)` ). Therefore, it seems more 
consistent that any call to `convert` inside `onMatch` would go via 
`call.getPlanner().convert(...)` .


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to