Search in sources :

Example 1 with VisualTableHandler

use of io.mycat.prototypeserver.mysql.VisualTableHandler in project Mycat2 by MyCATApache.

the class ComplierContext method getTableObservable.

public Observable<Object[]> getTableObservable(String schemaName, String tableName) {
    MetadataManager metadataManager = MetaClusterCurrent.wrapper(MetadataManager.class);
    TableHandler tableHandler = metadataManager.getTable(schemaName, tableName);
    VisualTableHandler visualTableHandler = (VisualTableHandler) tableHandler;
    return visualTableHandler.scanAll();
}
Also used : MetadataManager(io.mycat.MetadataManager) TableHandler(io.mycat.TableHandler) VisualTableHandler(io.mycat.prototypeserver.mysql.VisualTableHandler) VisualTableHandler(io.mycat.prototypeserver.mysql.VisualTableHandler)

Example 2 with VisualTableHandler

use of io.mycat.prototypeserver.mysql.VisualTableHandler in project Mycat2 by MyCATApache.

the class VisualTablePlanImpl method execute.

@Override
public Observable<VectorSchemaRoot> execute(RootContext rootContext) {
    RelOptTable table = relNode.getRelNode().getTable();
    MycatLogicTable logicTable = table.unwrap(MycatLogicTable.class);
    TableHandler tableHandler = logicTable.getTable();
    VisualTableHandler visualTableHandler = (VisualTableHandler) tableHandler;
    MetadataManager metadataManager = MetaClusterCurrent.wrapper(MetadataManager.class);
    MycatRelDataType mycatRelDataTypeByCalcite = relNode.getMycatRelDataTypeByCalcite();
    Schema schema = toArrowSchema(mycatRelDataTypeByCalcite);
    return ValuesPlan.create(schema, MycatRxJavaUtl.blockingIterable(visualTableHandler.scanAll())).execute(rootContext);
}
Also used : MetadataManager(io.mycat.MetadataManager) TableHandler(io.mycat.TableHandler) VisualTableHandler(io.mycat.prototypeserver.mysql.VisualTableHandler) MycatRelDataType(io.mycat.beans.mycat.MycatRelDataType) MycatLogicTable(io.mycat.calcite.table.MycatLogicTable) Schema(org.apache.arrow.vector.types.pojo.Schema) FactoryUtil.toArrowSchema(io.ordinate.engine.factory.FactoryUtil.toArrowSchema) VisualTableHandler(io.mycat.prototypeserver.mysql.VisualTableHandler) RelOptTable(org.apache.calcite.plan.RelOptTable)

Example 3 with VisualTableHandler

use of io.mycat.prototypeserver.mysql.VisualTableHandler in project Mycat2 by MyCATApache.

the class AsyncMycatDataContextImpl method getTableObservable.

@Override
public Observable<Object[]> getTableObservable(String schemaName, String tableName) {
    MetadataManager metadataManager = MetaClusterCurrent.wrapper(MetadataManager.class);
    TableHandler tableHandler = metadataManager.getTable(schemaName, tableName);
    VisualTableHandler visualTableHandler = (VisualTableHandler) tableHandler;
    return visualTableHandler.scanAll();
}
Also used : VisualTableHandler(io.mycat.prototypeserver.mysql.VisualTableHandler) VisualTableHandler(io.mycat.prototypeserver.mysql.VisualTableHandler)

Aggregations

VisualTableHandler (io.mycat.prototypeserver.mysql.VisualTableHandler)3 MetadataManager (io.mycat.MetadataManager)2 TableHandler (io.mycat.TableHandler)2 MycatRelDataType (io.mycat.beans.mycat.MycatRelDataType)1 MycatLogicTable (io.mycat.calcite.table.MycatLogicTable)1 FactoryUtil.toArrowSchema (io.ordinate.engine.factory.FactoryUtil.toArrowSchema)1 Schema (org.apache.arrow.vector.types.pojo.Schema)1 RelOptTable (org.apache.calcite.plan.RelOptTable)1