Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3227

IndexOutOfBound when checking candidate parent match's input ordinal in VolcanoRuleCall

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.21.0
    • None

    Description

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            botong Botong Huang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h

                Slack

                  Issue deployment