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

Modify Frameworks to allow Schema to be re-used

    Details

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

      Description

      `Frameworks` currently assumes that a `Schema` can only be created inside a connection, and therefore each optimizer run needs to create a new schema. The `getPlanner` method reflects this:

      ```java
      public static Planner getPlanner(
      Lex lex,
      Function1<SchemaPlus, Schema> schemaFactory,
      List<RelTraitDef> traitDefs,
      SqlStdOperatorTable operatorTable,
      RuleSet... ruleSets);
      ```

      Instead we should add

      ```java
      public static SchemaPlus createRootSchema()
      ```

      and let clients build their own schemas under that root schema that can be re-used. The signature of `getPlanner` would become

      ```java
      public static Planner getPlanner(
      Lex lex,
      SchemaPlus rootSchema,
      Schema defaultSchema,
      List<RelTraitDef> traitDefs,
      SqlStdOperatorTable operatorTable,
      RuleSet... ruleSets);
      ```

      `defaultSchema` can be null or a schema under `rootSchema`.

      ---------------- Imported from GitHub ----------------
      Url: https://github.com/julianhyde/optiq/issues/214
      Created by: julianhyde
      Labels:
      Created at: Sat Mar 29 22:50:22 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: