Esempio n. 1
0
  /**
   * Return reference to default schema instance in a schema tree. Each {@link
   * org.apache.calcite.schema.SchemaPlus} instance can refer to its parent and its children. From
   * the returned reference to default schema instance, clients can traverse the entire schema tree
   * and know the default schema where to look up the tables first.
   *
   * @return Reference to default schema instance in a schema tree.
   */
  public SchemaPlus getNewDefaultSchema() {
    final SchemaPlus rootSchema = getRootSchema();
    final SchemaPlus defaultSchema = session.getDefaultSchema(rootSchema);
    if (defaultSchema == null) {
      return rootSchema;
    }

    return defaultSchema;
  }