Search in sources :

Example 1 with MycatPhysicalTable

use of io.mycat.calcite.table.MycatPhysicalTable in project Mycat2 by MyCATApache.

the class HBTQueryConvertor method toPhyTable.

private RelNode toPhyTable(MycatLogicTable unwrap, Iterable<Partition> dataNodes) {
    int count = 0;
    for (Partition partition : dataNodes) {
        MycatPhysicalTable mycatPhysicalTable = new MycatPhysicalTable(unwrap, partition);
        LogicalTableScan tableScan = LogicalTableScan.create(relBuilder.getCluster(), RelOptTableImpl.create(relBuilder.getRelOptSchema(), unwrap.getRowType(), mycatPhysicalTable, ImmutableList.of(partition.getSchema(), partition.getTable())), ImmutableList.of());
        count++;
        relBuilder.push(tableScan);
    }
    return relBuilder.union(true, count).build();
}
Also used : Partition(io.mycat.Partition) MycatPhysicalTable(io.mycat.calcite.table.MycatPhysicalTable) LogicalTableScan(org.apache.calcite.rel.logical.LogicalTableScan)

Aggregations

Partition (io.mycat.Partition)1 MycatPhysicalTable (io.mycat.calcite.table.MycatPhysicalTable)1 LogicalTableScan (org.apache.calcite.rel.logical.LogicalTableScan)1