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

Optiq fails when call Planner.transform() multiple times, each with different ruleset.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      I'm trying to call Planner.transform(int ruleSetIndex,RelTraitSet requiredOutputTraits, RelNode rel) multiple times, and Optiq fails during the 2nd call of transform, complaining AssertionError "Used match list for phase PRE_PROCESS_MDR after phase complete" by org.eigenbase.relopt.volcano.RuleQueue.popMatch.

      The reason for this error is because during the first call of transform(), in VolcanoPlanner.findBestExp(), it will remove the PhaseMatchList for each phase in rule queue, once that phase is completed:
      ruleQueue.phaseCompleted(phase);

      In the following call of transform(), even there are new matched rules, those rules will not be able to be added to rule queue, since there is no PhaseMatchList for the phase in the rule queue.

      To address this issue, is it possible that optiq changes as following:
      1) In RuleQueue.phaseCompleted() call, we just clean up the PhaseMatchList, in stead of remove PhaseMatchList from rule queue.
      2) Move the logic of ruleQueue.phaseCompleted(phase) to Planner.clearRules()? That is, clearRules() will clear both the ruleset as well as rule queue ? Or is there any particular reason that the rule queue has to be cleaned up within findBestExp() call ?

      Thank you,

      ---------------- Imported from GitHub ----------------
      Url: https://github.com/julianhyde/optiq/issues/158
      Created by: jinfengni
      Labels:
      Created at: Tue Feb 25 20:27:49 CET 2014
      State: closed

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              github-import GitHub Import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: