[ 
https://issues.apache.org/jira/browse/CALCITE-3118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16858653#comment-16858653
 ] 

Botong Huang commented on CALCITE-3118:
---------------------------------------

Thanks [~danny0405] for reviewing! Having two relNodes of the same class in two 
RelSubsets in the same RelSet (thus the equivalent line) is the necessary 
condition to trigger this bug. However, using convention in the unit test is 
not a must. It's merely to produce the two subSets. Any two traits that are 
different would suffice.

Also as in AssertOperandsDifferentRule, it is not trying to match any 
convention. We are simply trying to match a parent with its first and second 
children being PhysLeafRel.class, it is wrong to return a match with a parent 
relNode and both its second children.

> VolcanoRuleCall match parent child ordinal not properly checked
> ---------------------------------------------------------------
>
>                 Key: CALCITE-3118
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3118
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Botong Huang
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> In VolcanoRuleCall.matchRecurse(), when ascending (child operand is matched, 
> looking for parent operand match), we want to check that the matched parent 
> indeed has the previously matched child RelNode as a child with the expected 
> ordinal. However, there is a bug in this check. As a result, some incorrect 
> parent is not skipped as expected and matched incorrectly. See unit test 
> included in PR for a case that triggers this bug, where the same RelNode get 
> matched for two operands at the same time. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to