org.eigenbase.rel
Class SetOpRel

java.lang.Object
  extended by org.eigenbase.rel.AbstractRelNode
      extended by org.eigenbase.rel.SetOpRel
All Implemented Interfaces:
Cloneable, RelNode
Direct Known Subclasses:
IntersectRel, MinusRel, UnionRelBase

public abstract class SetOpRel
extends AbstractRelNode

SetOpRel is an abstract base for relational set operators such as union, minus, and intersect.

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

Field Summary
protected  boolean all
           
protected  RelNode[] inputs
           
 
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 SetOpRel(RelOptCluster cluster, RelTraitSet traits, RelNode[] inputs, boolean all)
           
 
Method Summary
abstract  SetOpRel clone(RelNode[] inputs, boolean all)
           
protected  RelDataType deriveRowType()
           
 void explain(RelOptPlanWriter pw)
           
 RelNode[] getInputs()
          Returns an array of this relational expression's inputs.
 boolean isDistinct()
          Returns whether the same value will not come out twice.
 boolean isHomogeneous()
          Returns whether all the inputs of this set operator have the same row type as its output row.
 boolean isHomogeneous(boolean compareNames)
          Returns whether all the inputs of this set operator have the same row type as its output row.
 void replaceInput(int ordinalInParent, RelNode p)
          Replaces the ordinalInParentth input.
 
Methods inherited from class org.eigenbase.rel.AbstractRelNode
childrenAccept, clone, cloneTraits, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getOrCreateCorrelVariable, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraits, getVariablesStopped, inheritTraitsFrom, isAccessTo, 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

inputs

protected RelNode[] inputs

all

protected boolean all
Constructor Detail

SetOpRel

protected SetOpRel(RelOptCluster cluster,
                   RelTraitSet traits,
                   RelNode[] inputs,
                   boolean all)
Method Detail

clone

public abstract SetOpRel clone(RelNode[] inputs,
                               boolean all)

isDistinct

public boolean isDistinct()
Description copied from interface: RelNode
Returns whether the same value will not come out twice. Default value is false, derived classes should override.

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

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

explain

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

replaceInput

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

isHomogeneous

public boolean isHomogeneous(boolean compareNames)
Returns whether all the inputs of this set operator have the same row type as its output row.

Parameters:
compareNames - whether or not column names are important in the homogeneity comparison

isHomogeneous

public boolean isHomogeneous()
Returns whether all the inputs of this set operator have the same row type as its output row. Equivalent to isHomogeneous(true).