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

OptiqSchema#getSubSchema does not find schemas provided through Schema#getSubSchemaNames

    XMLWordPrintableJSON

Details

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

    Description

      Sub schemas of schemas passed to the OptiqSchema constructor are not visible through the OptiqSchema API, unless the compositeSubSchemaMap is iterated first.

      This is because compositeSubSchemaMap is a composite map that has a map that's a view of a function as one of its components. The function has the side effect that the sub schema is added to the OptiqSchema, hence iterating over the map (e.g., by inspecting it in a debugger) adds the sub schemas to the OptiqSchema.

      This is the code in OptiqSchema constructor:

      this.compositeSubSchemaMap =
      CompositeMap.of(
      subSchemaMap,
      Compatible.INSTANCE.asMap(
      schema.getSubSchemaNames(),
      new com.google.common.base.Function<String, OptiqSchema>() {
      public OptiqSchema apply(String name)

      { return add(name, schema.getSubSchema(name)); }

      }));

      `OptiqSchema#getTable` appears to address this by actually using the composite map (`getSubSchema` doesn't use it) if caseSensitive, and explicitly iterating over the names provided by the Schema if not caseSensitive. Perhaps a similar strategy should be used in `getSubSchema`?

      This is in optiq version 0.6.

      ---------------- Imported from GitHub ----------------
      Url: https://github.com/julianhyde/optiq/issues/251
      Created by: tvo
      Labels:
      Created at: Wed Apr 16 07:29:44 CEST 2014
      State: closed

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: