[ https://issues.apache.org/jira/browse/CALCITE-3227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Haisheng Yuan resolved CALCITE-3227. ------------------------------------ Resolution: Fixed Fix Version/s: 1.21.0 Fixed in https://github.com/apache/calcite/commit/979a825fab0757c506363f5df6ed7997674e8726, thanks for the PR, [~botong]! > 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 > Priority: Major > Labels: pull-request-available > Fix For: 1.21.0 > > Time Spent: 20m > Remaining Estimate: 0h > > 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)