Skip to content

[CALCITE-5260] Pop the last RelNode added into the bindings list when failing to apply a rule - #2891

Open
wangyeweikuer wants to merge 1 commit into
apache:mainfrom
wangyeweikuer:CALCITE-5260
Open

[CALCITE-5260] Pop the last RelNode added into the bindings list when failing to apply a rule#2891
wangyeweikuer wants to merge 1 commit into
apache:mainfrom
wangyeweikuer:CALCITE-5260

Conversation

@wangyeweikuer

Copy link
Copy Markdown

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.

@libenchao

Copy link
Copy Markdown
Member

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

Stack<RelNode> bindings,
Map<RelNode, List<RelNode>> nodeChildren) {
if (!operand.matches(rel)) {
return false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants