baremaps-calcite/src/main/java/org/apache/baremaps/calcite/BaremapsDdlExecutor.java [119:142]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  static SchemaInfo schema(
      CalcitePrepare.Context context, boolean mutable, SqlIdentifier id) {
    final String name;
    final List<String> path;
    if (id.isSimple()) {
      path = context.getDefaultSchemaPath();
      name = id.getSimple();
    } else {
      path = Util.skipLast(id.names);
      name = Util.last(id.names);
    }
    CalciteSchema schema =
        mutable ? context.getMutableRootSchema()
            : context.getRootSchema();
    for (String p : path) {
      @Nullable
      CalciteSchema subSchema = schema.getSubSchema(p, true);
      if (subSchema == null) {
        return new SchemaInfo(name, null);
      }
      schema = subSchema;
    }
    return new SchemaInfo(name, schema);
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



baremaps-calcite/src/main/java/org/apache/baremaps/calcite/postgres/PostgresDdlExecutor.java [147:170]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  static SchemaInfo schema(
      CalcitePrepare.Context context, boolean mutable, SqlIdentifier id) {
    final String name;
    final List<String> path;
    if (id.isSimple()) {
      path = context.getDefaultSchemaPath();
      name = id.getSimple();
    } else {
      path = Util.skipLast(id.names);
      name = Util.last(id.names);
    }
    CalciteSchema schema =
        mutable ? context.getMutableRootSchema()
            : context.getRootSchema();
    for (String p : path) {
      @Nullable
      CalciteSchema subSchema = schema.getSubSchema(p, true);
      if (subSchema == null) {
        return new SchemaInfo(name, null);
      }
      schema = subSchema;
    }
    return new SchemaInfo(name, schema);
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



