net.sf.farrago.query
Class FarragoPreparingStmt.PermutingRelOptTable
java.lang.Object
org.eigenbase.relopt.RelOptAbstractTable
net.sf.farrago.query.FarragoPreparingStmt.PermutingRelOptTable
- All Implemented Interfaces:
- RelOptTable
- Enclosing class:
- FarragoPreparingStmt
protected class FarragoPreparingStmt.PermutingRelOptTable
- extends RelOptAbstractTable
Transform which permutes the columns of an input table, applying casts
amd renaming columns if necessary, to make the output rowtype match the
desired rowtype.
The input table must have a superset of the columns of the output
rowtype, and their types must be coercible into the output types.
Conversion is performed by the SqlToRelConverter.convertField(org.eigenbase.reltype.RelDataType, org.eigenbase.reltype.RelDataTypeField)
method.
The transform generally generates an extra CalcRel
during the
conversion to a RelNode
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
inputTable
private final RelOptTable inputTable
FarragoPreparingStmt.PermutingRelOptTable
protected FarragoPreparingStmt.PermutingRelOptTable(RelOptSchema schema,
String name,
RelDataType rowType,
RelOptTable inputTable)
- Creates a table which converts an input row type to a desired output
row type, shuffling and casting columns in order to do so.
- Parameters:
schema
- Schema the table belongs toname
- Name of this tablerowType
- Output row type of this tableinputTable
- Input table
toRel
public RelNode toRel(RelOptCluster cluster,
RelOptConnection connection)
- Description copied from interface:
RelOptTable
- Converts this table into a
relational expression
.
The planner
calls this
method to convert a table into an initial relational expression,
generally something abstract, such as a TableAccessRel
, then optimizes this expression by
applying rules
to transform it
into more efficient access methods for this table.
- Parameters:
cluster
- the cluster the relational expression will belong toconnection
- the parse tree of the expression which evaluates to a
connection object