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 2022/09/02 08:14:01 UTC

[GitHub] [calcite] wangyeweikuer opened a new pull request, #2891: [CALCITE-5260] Pop the last RelNode added into the bindings list when failing to apply a rule

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

   When fail to match a subtree, HepPlanner should pop the last RelNode added into the bindings list, where the nodes left are 'real' matched when applying a rule. 
   
   Otherwise, using some temporary and unnecessary nodes to construct a HepRuleCall will cause an assertion error.
   


-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [calcite] libenchao commented on pull request #2891: [CALCITE-5260] Pop the last RelNode added into the bindings list when failing to apply a rule

Posted by GitBox <gi...@apache.org>.
libenchao commented on PR #2891:
URL: https://github.com/apache/calcite/pull/2891#issuecomment-1236275629

   @wangyeweikuer Thanks for your contribution, could you add some tests which will fail without your fix? This will make us easier to understand the PR.


-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [calcite] chunweilei commented on a diff in pull request #2891: [CALCITE-5260] Pop the last RelNode added into the bindings list when failing to apply a rule

Posted by GitBox <gi...@apache.org>.
chunweilei commented on code in PR #2891:
URL: https://github.com/apache/calcite/pull/2891#discussion_r974815308


##########
core/src/main/java/org/apache/calcite/plan/hep/HepPlanner.java:
##########
@@ -614,7 +615,7 @@ private List<HepRelVertex> getVertexParents(HepRelVertex vertex) {
   private static boolean matchOperands(
       RelOptRuleOperand operand,
       RelNode rel,
-      List<RelNode> bindings,
+      Stack<RelNode> bindings,
       Map<RelNode, List<RelNode>> nodeChildren) {
     if (!operand.matches(rel)) {
       return false;

Review Comment:
   Could you add a test case?



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org