org.eigenbase.rel
Class TableFunctionRelBase

java.lang.Object
  extended by org.eigenbase.rel.AbstractRelNode
      extended by org.eigenbase.rel.TableFunctionRelBase
All Implemented Interfaces:
Cloneable, RelNode
Direct Known Subclasses:
FarragoJavaUdxRel, TableFunctionRel

public abstract class TableFunctionRelBase
extends AbstractRelNode

TableFunctionRelBase is an abstract base class for implementations of TableFunctionRel.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/rel/TableFunctionRelBase.java#9 $
Author:
John V. Sichi

Field Summary
private  Set<RelColumnMapping> columnMappings
           
protected  RelNode[] inputs
           
private  RexNode rexCall
           
private  RelDataType rowType
           
 
Fields inherited from class org.eigenbase.rel.AbstractRelNode
digest, id, nextId, traits
 
Fields inherited from interface org.eigenbase.rel.RelNode
emptyArray
 
Constructor Summary
protected TableFunctionRelBase(RelOptCluster cluster, RelTraitSet traits, RexNode rexCall, RelDataType rowType, RelNode[] inputs)
          Creates a TableFunctionRelBase.
 
Method Summary
protected  RelDataType deriveRowType()
           
 void explain(RelOptPlanWriter pw)
           
 RexNode getCall()
           
 RexNode[] getChildExps()
          Returns an array of this relational expression's child expressions (not including the inputs returned by RelNode.getInputs().
 Set<RelColumnMapping> getColumnMappings()
           
 RelNode[] getInputs()
          Returns an array of this relational expression's inputs.
 double getRows()
          Returns an estimate of the number of rows this relational expression will return.
 void replaceInput(int ordinalInParent, RelNode p)
          Replaces the ordinalInParentth input.
 void setColumnMappings(Set<RelColumnMapping> columnMappings)
          Declares the column mappings associated with this function.
 
Methods inherited from class org.eigenbase.rel.AbstractRelNode
childrenAccept, clone, cloneTraits, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getOrCreateCorrelVariable, getQuery, getRelTypeName, getRowType, getTable, getTraits, getVariablesStopped, inheritTraitsFrom, isAccessTo, isDistinct, isValid, onRegister, recomputeDigest, register, registerCorrelVariable, setCorrelVariable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rexCall

private final RexNode rexCall

rowType

private final RelDataType rowType

inputs

protected final RelNode[] inputs

columnMappings

private Set<RelColumnMapping> columnMappings
Constructor Detail

TableFunctionRelBase

protected TableFunctionRelBase(RelOptCluster cluster,
                               RelTraitSet traits,
                               RexNode rexCall,
                               RelDataType rowType,
                               RelNode[] inputs)
Creates a TableFunctionRelBase.

Parameters:
cluster - RelOptCluster this relational expression belongs to
rexCall - function invocation expression
rowType - row type produced by function
inputs - 0 or more relational inputs
Method Detail

getInputs

public RelNode[] getInputs()
Description copied from interface: RelNode
Returns an array of this relational expression's inputs. If there are no inputs, returns an empty array, not null.

Specified by:
getInputs in interface RelNode
Overrides:
getInputs in class AbstractRelNode

replaceInput

public void replaceInput(int ordinalInParent,
                         RelNode p)
Description copied from interface: RelNode
Replaces the ordinalInParentth input. You must override this method if you override RelNode.getInputs().

Specified by:
replaceInput in interface RelNode
Overrides:
replaceInput in class AbstractRelNode

getChildExps

public RexNode[] getChildExps()
Description copied from interface: RelNode
Returns an array of this relational expression's child expressions (not including the inputs returned by RelNode.getInputs(). If there are no child expressions, returns an empty array, not null.

Specified by:
getChildExps in interface RelNode
Overrides:
getChildExps in class AbstractRelNode

getRows

public double getRows()
Description copied from interface: RelNode
Returns an estimate of the number of rows this relational expression will return.

NOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use RelMetadataQuery.getRowCount(org.eigenbase.rel.RelNode), which gives plugins a chance to override the rel's default ideas about row count.

Specified by:
getRows in interface RelNode
Overrides:
getRows in class AbstractRelNode

getCall

public RexNode getCall()

explain

public void explain(RelOptPlanWriter pw)
Specified by:
explain in interface RelNode
Overrides:
explain in class AbstractRelNode

getColumnMappings

public Set<RelColumnMapping> getColumnMappings()
Returns:
set of mappings known for this table function, or null if unknown (not the same as empty!)

setColumnMappings

public void setColumnMappings(Set<RelColumnMapping> columnMappings)
Declares the column mappings associated with this function. REVIEW jvs 11-Aug-2006: Should this be set only on construction, made part of digest, etc?

Parameters:
columnMappings - new mappings to set

deriveRowType

protected RelDataType deriveRowType()
Overrides:
deriveRowType in class AbstractRelNode