org.eigenbase.rel
Class ProjectRelBase

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

public abstract class ProjectRelBase
extends SingleRel

ProjectRelBase is an abstract base class for implementations of ProjectRel.

Since:
March, 2004
Version:
$Id: //open/dev/farrago/src/org/eigenbase/rel/ProjectRelBase.java#23 $
Author:
jhyde

Nested Class Summary
private static class ProjectRelBase.Checker
          Visitor which walks over a program and checks validity.
static interface ProjectRelBase.Flags
           
 
Field Summary
private  List<RelCollation> collationList
           
protected  RexNode[] exps
           
protected  int flags
          Values defined in ProjectRelBase.Flags.
 
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 ProjectRelBase(RelOptCluster cluster, RelTraitSet traits, RelNode child, RexNode[] exps, RelDataType rowType, int flags, List<RelCollation> collationList)
          Creates a Project.
 
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.
 int getFlags()
           
 RexNode[] getProjectExps()
          Returns the project expressions.
 JavaRel implementFieldAccess(JavaRelImplementor implementor, String fieldName)
          Burrows into a synthetic record and returns the underlying relation which provides the field called fieldName.
 boolean isBoxed()
           
 boolean isValid(boolean fail)
          Returns whether this relational expression is valid.
 
Methods inherited from class org.eigenbase.rel.SingleRel
childrenAccept, deriveRowType, getChild, getInputs, getRows, 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

exps

protected RexNode[] exps

flags

protected int flags
Values defined in ProjectRelBase.Flags.


collationList

private final List<RelCollation> collationList
Constructor Detail

ProjectRelBase

protected ProjectRelBase(RelOptCluster cluster,
                         RelTraitSet traits,
                         RelNode child,
                         RexNode[] exps,
                         RelDataType rowType,
                         int flags,
                         List<RelCollation> collationList)
Creates a Project.

Parameters:
cluster - Cluster this relational expression belongs to
traits - traits of this rel
child - input relational expression
exps - set of expressions for the input columns
rowType - output row type
flags - values as in ProjectRelBase.Flags
collationList - List of sort keys
Method Detail

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

isBoxed

public boolean isBoxed()

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

getProjectExps

public RexNode[] getProjectExps()
Returns the project expressions.


getFlags

public int getFlags()

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

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

explain

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

implementFieldAccess

public JavaRel implementFieldAccess(JavaRelImplementor implementor,
                                    String fieldName)
Burrows into a synthetic record and returns the underlying relation which provides the field called fieldName.