use of org.apache.calcite.schema.TransientTable 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;
}
Aggregations