org.eigenbase.rel
Class SortRel

java.lang.Object
  extended by org.eigenbase.rel.AbstractRelNode
      extended by org.eigenbase.rel.SingleRel
          extended by org.eigenbase.rel.SortRel
All Implemented Interfaces:
Cloneable, RelNode

public final class SortRel
extends SingleRel

Relational expression which imposes a particular sort order on its input without otherwise changing its content.


Field Summary
protected  RelFieldCollation[] collations
           
protected  RexNode[] fieldExps
           
 
Fields inherited from class org.eigenbase.rel.AbstractRelNode
digest, id, nextId, rowType, traits
 
Fields inherited from interface org.eigenbase.rel.RelNode
emptyArray
 
Constructor Summary
SortRel(RelOptCluster cluster, RelNode child, RelFieldCollation[] collations)
          Creates a sorter.
 
Method Summary
 SortRel clone()
          Clones this RelNode.
 void explain(RelOptPlanWriter pw)
           
 RexNode[] getChildExps()
          Returns an array of this relational expression's child expressions (not including the inputs returned by RelNode.getInputs().
 RelFieldCollation[] getCollations()
           
 
Methods inherited from class org.eigenbase.rel.SingleRel
childrenAccept, deriveRowType, getChild, getInputs, getRows, replaceInput
 
Methods inherited from class org.eigenbase.rel.AbstractRelNode
cloneTraits, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, 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

collations

protected final RelFieldCollation[] collations

fieldExps

protected final RexNode[] fieldExps
Constructor Detail

SortRel

public SortRel(RelOptCluster cluster,
               RelNode child,
               RelFieldCollation[] collations)
Creates a sorter.

Parameters:
cluster - RelOptCluster this relational expression belongs to
child - input relational expression
collations - array of sort specifications
Method Detail

clone

public SortRel clone()
Description copied from interface: RelNode
Clones this RelNode.

Traits of the RelNode must be explicitly cloned, using AbstractRelNode.inheritTraitsFrom(AbstractRelNode), as the RelNode may have traits of which it has no knowledge. Example implementation:

     public MyRelNode clone()
     {
         MyRelNode clone = new MyRelNode(...);
         clone.inheritTraitsFrom(this);
         return clone;
     }
 
N.B.: This method must be overridden whenever an existing, concrete RelNode is extended. Otherwise, calling clone() will produce a differently typed RelNode, resulting in invalid or incorrect query plans.

Specified by:
clone in interface RelNode
Specified by:
clone in class AbstractRelNode
Returns:
a clone of this RelNode

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

getCollations

public RelFieldCollation[] getCollations()
Returns:
array of RelFieldCollations, from most significant to least significant

explain

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