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

Calcite hit Assertion Error when calling Frameworks.planner or RelOptRule.convert(), if the target trait is composite

    XMLWordPrintableJSON

    Details

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

      Description

      CALCITE-88 introduces the concept of RelCompositeTrait. As such, Calcite seems to require that each new RelSubSet should only have simple trait, in stead of composite traits. If that condition is not meet, an assertion will be thrown.

      However, when we use Frameworks.planner to call transform(), or use RelOptRule to call convert() method, there is no guarantee that the target traits are simple. If the target traits happened to be composite, then Calcite will hit Assertion at RelSubset.java:108.

      There seems to be two options to fix this Assertion and ensure RelSubset only have simple traitsets :
      1) Follow the way Prepare.optimize(), and call simplify() for the target traitset, in both PlannerImpl.transform() or RelOptRule.convert().

      2) Each callers of transform(), or convert() method should make sure the target traits are simple.

      The patch I'm going to submit uses the 1st option, using the same logic in Prepare.optimize().

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              jni Jinfeng Ni
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: