org.eigenbase.rel
Class CalcRelBase

java.lang.Object
  extended by org.eigenbase.rel.AbstractRelNode
      extended by org.eigenbase.rel.SingleRel
          extended by org.eigenbase.rel.CalcRelBase
All Implemented Interfaces:
Cloneable, RelNode
Direct Known Subclasses:
CalcRel

public abstract class CalcRelBase
extends SingleRel

CalcRelBase is an abstract base class for implementations of CalcRel.

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

Field Summary
private  List<RelCollation> collationList
           
protected  RexProgram program
           
 
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 CalcRelBase(RelOptCluster cluster, RelTraitSet traits, RelNode child, RelDataType rowType, RexProgram program, List<RelCollation> collationList)
           
 
Method Summary
 RelOptCost computeSelfCost(RelOptPlanner planner)
          Returns the cost of this plan (not including children).
 void explain(RelOptPlanWriter pw)
           
 RexNode[] getChildExps()
          Returns an array of this relational expression's child expressions (not including the inputs returned by RelNode.getInputs().
 List<RelCollation> getCollationList()
          Returns a description of the physical ordering (or orderings) of this relational expression.
 RexProgram getProgram()
           
 double getRows()
          Returns an estimate of the number of rows this relational expression will return.
 boolean isValid(boolean fail)
          Returns whether this relational expression is valid.
 
Methods inherited from class org.eigenbase.rel.SingleRel
childrenAccept, deriveRowType, getChild, getInputs, replaceInput
 
Methods inherited from class org.eigenbase.rel.AbstractRelNode
clone, cloneTraits, collectVariablesSet, collectVariablesUsed, computeDigest, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getOrCreateCorrelVariable, getQuery, getRelTypeName, getRowType, getTable, getTraits, getVariablesStopped, inheritTraitsFrom, isAccessTo, isDistinct, onRegister, recomputeDigest, register, registerCorrelVariable, setCorrelVariable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

program

protected final RexProgram program

collationList

private final List<RelCollation> collationList
Constructor Detail

CalcRelBase

protected CalcRelBase(RelOptCluster cluster,
                      RelTraitSet traits,
                      RelNode child,
                      RelDataType rowType,
                      RexProgram program,
                      List<RelCollation> collationList)
Method Detail

isValid

public boolean isValid(boolean fail)
Description copied from interface: RelNode
Returns whether this relational expression is valid.

If assertions are enabled, this method is typically called with fail = true, as follows:

assert rel.isValid(true)
This signals that the method can throw an AssertionError if it is not valid.

Specified by:
isValid in interface RelNode
Overrides:
isValid in class AbstractRelNode
Parameters:
fail - Whether to fail if invalid
Returns:
Whether relational expression is valid

getProgram

public RexProgram getProgram()

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 SingleRel

getCollationList

public List<RelCollation> getCollationList()
Description copied from interface: RelNode
Returns a description of the physical ordering (or orderings) of this relational expression.

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

computeSelfCost

public RelOptCost computeSelfCost(RelOptPlanner planner)
Description copied from interface: RelNode
Returns the cost of this plan (not including children). The base implementation throws an error; derived classes should override.

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

Specified by:
computeSelfCost in interface RelNode
Overrides:
computeSelfCost 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

explain

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