Botong Huang created CALCITE-3227: ------------------------------------- Summary: IndexOutOfBound when checking candidate parent match's input ordinal in VolcanoRuleCall Key: CALCITE-3227 URL: https://issues.apache.org/jira/browse/CALCITE-3227 Project: Calcite Issue Type: Bug Reporter: Botong Huang
In VolcanoRuleCall.matchRecurse(), when ascending (child operand is matched, looking for parent operand match), we want to check that the candidate parent relNode indeed has the previously matched relNode as a child with the right ordinal. However, some candidate parent can have less number of inputs than the parent operand, and thus we hit IndexOutOfBound when trying to grab the correct child for checking. In the added unit test that repro the bug, we have a union with two inputs of class PhysLeafRel. The rule however, matches a union with three inputs, with the third child operand matching for PhysLeafRel.class. When a child relNode gets matched to the third child operand, we go up trying to see whether the union relNode can match the parent. Trying to access the union's third input hits the IndexOutOfBound error because the union only has two inputs. -- This message was sent by Atlassian JIRA (v7.6.14#76016)