[
https://issues.apache.org/jira/browse/CALCITE-5260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17599024#comment-17599024
]
Benchao Li commented on CALCITE-5260:
-------------------------------------
[~mengdou] To assign this to yourself, you need to apply for contributor
permission in the Calcite dev mailing list.
Besides, we do not encourage to use pictures in Jira because it's not
searchable. Could you try to rephrase the description and make the problem
clear? To be honest, I didn't get what's the problem you are proposing to fix.
> The bindings should properly pop last added RelNode when fail to match a
> subtree
> --------------------------------------------------------------------------------
>
> Key: CALCITE-5260
> URL: https://issues.apache.org/jira/browse/CALCITE-5260
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.31.0
> Reporter: mengdou
> Priority: Minor
> Attachments: image-2022-09-01-19-34-04-600.png,
> image-2022-09-01-19-36-29-325.png, image-2022-09-01-19-41-48-852.png,
> image-2022-09-01-19-42-08-804.png
>
>
> First I define a pattern(For demonstration) like this:
> {code:java}
> // pattern like this, using 'unordered' child policy for MultiJoin
> operandJ(MultiJoin.class, ...
> unordered(
> operand(Project.class, ...
> operand(TableScan.class, ...))))
> {code}
> Then there is a RelNode tree like this:
> {code:java}
> MultiJoin
> Project
> Filter -- matched unsuccessfully and jump out
> TableScan
> Project
> TableScan -- matched successfully{code}
> and HepPlanner adds temporary nodes into 'bindings' list when applying a rule
> and trying to match operands:
> !image-2022-09-01-19-34-04-600.png!
> When fail to match a subtree, HepPlanner would jump out immediately and try
> other possible subtrees, but DO NOT pop the last added node:
> !image-2022-09-01-19-36-29-325.png!
>
> If HepPlanner matches a subtree for current rule finally, it will constructs
> a HepRuleCall using bindings as the matched relnodes, which contains
> unnecessary nodes yet
> !image-2022-09-01-19-41-48-852.png!
> And an assertion in constructor fails
> !image-2022-09-01-19-42-08-804.png!
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)