Search in sources :

Example 1 with ListTransientTable

use of org.apache.calcite.schema.impl.ListTransientTable in project calcite by apache.

the class RelBuilder method transientScan.

/**
 * Creates a {@link TableScan} on a {@link TransientTable} with the given name and type.
 *
 * @param tableName table name
 * @param rowType row type of the table
 */
@Experimental
public RelBuilder transientScan(String tableName, RelDataType rowType) {
    TransientTable transientTable = new ListTransientTable(tableName, rowType);
    requireNonNull(relOptSchema, "relOptSchema");
    RelOptTable relOptTable = RelOptTableImpl.create(relOptSchema, rowType, transientTable, ImmutableList.of(tableName));
    RelNode scan = struct.scanFactory.createScan(ViewExpanders.toRelContext(viewExpander, cluster), relOptTable);
    push(scan);
    rename(rowType.getFieldNames());
    return this;
}
Also used : ListTransientTable(org.apache.calcite.schema.impl.ListTransientTable) TransientTable(org.apache.calcite.schema.TransientTable) RelNode(org.apache.calcite.rel.RelNode) ListTransientTable(org.apache.calcite.schema.impl.ListTransientTable) RelOptTable(org.apache.calcite.plan.RelOptTable) Experimental(org.apache.calcite.linq4j.function.Experimental)

Aggregations

Experimental (org.apache.calcite.linq4j.function.Experimental)1 RelOptTable (org.apache.calcite.plan.RelOptTable)1 RelNode (org.apache.calcite.rel.RelNode)1 TransientTable (org.apache.calcite.schema.TransientTable)1 ListTransientTable (org.apache.calcite.schema.impl.ListTransientTable)1