net.sf.farrago.fennel.rel
Class FennelOptionalRel

java.lang.Object
  extended by org.eigenbase.rel.AbstractRelNode
      extended by org.eigenbase.rel.SingleRel
          extended by net.sf.farrago.fennel.rel.FennelSingleRel
              extended by net.sf.farrago.fennel.rel.FennelOptionalRel
All Implemented Interfaces:
Cloneable, FennelRel, RelNode
Direct Known Subclasses:
LcsIndexOnlyScanRel, LcsIndexSearchRel

public abstract class FennelOptionalRel
extends FennelSingleRel

FennelOptionalRel is a FennelRel which either takes zero inputs or takes a single FennelRel as input.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/fennel/rel/FennelOptionalRel.java#1 $
Author:
John Pham

Field Summary
 
Fields inherited from class org.eigenbase.rel.AbstractRelNode
digest, id, rowType, traits
 
Fields inherited from interface net.sf.farrago.query.FennelRel
FENNEL_EXEC_CONVENTION
 
Fields inherited from interface org.eigenbase.rel.RelNode
emptyArray
 
Constructor Summary
protected FennelOptionalRel(RelOptCluster cluster)
          Creates a new FennelOptionalRel object without an input rel.
protected FennelOptionalRel(RelOptCluster cluster, RelNode child)
          Creates a new FennelOptionalRel object with an input rel.
 
Method Summary
 void childrenAccept(RelVisitor visitor)
          Interacts with the RelVisitor in a visitor pattern to traverse the tree of relational expressions.
 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.
 Object implementFennelChild(FennelRelImplementor implementor)
          Visits this relational expression as part of the implementation process.
 
Methods inherited from class net.sf.farrago.fennel.rel.FennelSingleRel
getCollations, getFarragoTypeFactory
 
Methods inherited from class org.eigenbase.rel.SingleRel
deriveRowType, explain, getChild, replaceInput
 
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
 
Methods inherited from interface net.sf.farrago.query.FennelRel
toStreamDef
 
Methods inherited from interface org.eigenbase.rel.RelNode
clone, collectVariablesSet, collectVariablesUsed, computeSelfCost, explain, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getOrCreateCorrelVariable, getQuery, getRelTypeName, getRowType, getTable, getTraits, getVariablesStopped, isAccessTo, isDistinct, isValid, onRegister, recomputeDigest, registerCorrelVariable, replaceInput, setCorrelVariable
 

Constructor Detail

FennelOptionalRel

protected FennelOptionalRel(RelOptCluster cluster,
                            RelNode child)
Creates a new FennelOptionalRel object with an input rel.

Parameters:
cluster - RelOptCluster for this rel
child - input rel

FennelOptionalRel

protected FennelOptionalRel(RelOptCluster cluster)
Creates a new FennelOptionalRel object without an input rel.

Parameters:
cluster - RelOptCluster for this rel
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 SingleRel

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 SingleRel

implementFennelChild

public Object implementFennelChild(FennelRelImplementor implementor)
Description copied from interface: FennelRel
Visits this relational expression as part of the implementation process. Fennel relational expressions are implemented in a two-phase process: first call this method, then call FennelRel.toStreamDef(net.sf.farrago.query.FennelRelImplementor).

Specified by:
implementFennelChild in interface FennelRel
Overrides:
implementFennelChild in class FennelSingleRel

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