org.eigenbase.rel
Class FilterRelBase

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

public abstract class FilterRelBase
extends SingleRel

FilterRelBase is an abstract base class for implementations of FilterRel.

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

Field Summary
private  RexNode condition
           
 
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 FilterRelBase(RelOptCluster cluster, RelTraitSet traits, RelNode child, RexNode condition)
          Creates a filter.
 
Method Summary
 RelOptCost computeSelfCost(RelOptPlanner planner)
          Returns the cost of this plan (not including children).
static double estimateFilteredRows(RelNode child, RexNode condition)
           
static double estimateFilteredRows(RelNode child, RexProgram program)
           
 void explain(RelOptPlanWriter pw)
           
 RexNode[] getChildExps()
          Returns an array of this relational expression's child expressions (not including the inputs returned by RelNode.getInputs().
 RexNode getCondition()
           
 double getRows()
          Returns an estimate of the number of rows this relational expression will return.
 
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, 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

condition

private final RexNode condition
Constructor Detail

FilterRelBase

protected FilterRelBase(RelOptCluster cluster,
                        RelTraitSet traits,
                        RelNode child,
                        RexNode condition)
Creates a filter.

Parameters:
cluster - RelOptCluster this relational expression belongs to
traits - the traits of this rel
child - input relational expression
condition - boolean expression which determines whether a row is allowed to pass
Method Detail

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

getCondition

public RexNode getCondition()

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

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

estimateFilteredRows

public static double estimateFilteredRows(RelNode child,
                                          RexProgram program)

estimateFilteredRows

public static double estimateFilteredRows(RelNode child,
                                          RexNode condition)

explain

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