[Apache Calcite] 创建RelOptSchema

161 阅读1分钟

 

RelOptSchema在Calcite里面是通过CatalogReader表达

    final JavaTypeFactory typeFactory = prepareContext.getTypeFactory();
    final CalciteSchema schema =
        config.getDefaultSchema() != null
            ? CalciteSchema.from(config.getDefaultSchema())
            : prepareContext.getRootSchema();
    CalciteCatalogReader catalogReader =
        new CalciteCatalogReader(schema.root(),
            schema.path(null),
            typeFactory,
            prepareContext.config());