org.eigenbase.rel
Class SingleRel

java.lang.Object
  extended by org.eigenbase.rel.AbstractRelNode
      extended by org.eigenbase.rel.SingleRel
All Implemented Interfaces:
Cloneable, RelNode
Direct Known Subclasses:
AggregateRelBase, CalcRelBase, CollectRel, ConverterRelImpl, FarragoIndexBuilderRel, FennelSingleRel, FilterRelBase, IterCalcRel, ProjectRelBase, SamplingRel, SortRel, TableModificationRelBase, UncollectRel, VolcanoPlannerTest.TestSingleRel, VolcanoPlannerTraitTest.TestSingleRel, WindowedAggregateRel

public abstract class SingleRel
extends AbstractRelNode

A SingleRel is a base class single-input relational expressions.

Since:
23 September, 2001
Version:
$Id: //open/dev/farrago/src/org/eigenbase/rel/SingleRel.java#13 $
Author:
jhyde

Field Summary
private  RelNode child
           
 
Fields inherited from class org.eigenbase.rel.AbstractRelNode
digest, id, nextId, rowType, traits
 
Fields inherited from interface org.eigenbase.rel.RelNode
emptyArray
 
Constructor Summary
protected SingleRel(RelOptCluster cluster, RelTraitSet traits, RelNode child)
          Creates a SingleRel.
 
Method Summary
 void childrenAccept(RelVisitor visitor)
          Interacts with the RelVisitor in a visitor pattern to traverse the tree of relational expressions.
protected  RelDataType deriveRowType()
           
 void explain(RelOptPlanWriter pw)
           
 RelNode getChild()
           
 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 rel)
          Replaces the ordinalInParentth input.
 
Methods inherited from class org.eigenbase.rel.AbstractRelNode
clone, cloneTraits, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, getChildExps, 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

child

private RelNode child
Constructor Detail

SingleRel

protected SingleRel(RelOptCluster cluster,
                    RelTraitSet traits,
                    RelNode child)
Creates a SingleRel.

Parameters:
cluster - RelOptCluster this relational expression belongs to
child - input relational expression
Method Detail

getChild

public RelNode getChild()

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

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

childrenAccept

public void childrenAccept(RelVisitor visitor)
Description copied from interface: RelNode
Interacts with the RelVisitor in a visitor pattern to traverse the tree of relational expressions.

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

explain

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

replaceInput

public void replaceInput(int ordinalInParent,
                         RelNode rel)
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

deriveRowType

protected RelDataType deriveRowType()
Overrides:
deriveRowType in class AbstractRelNode