Class SortRel

  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
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


protected final RelFieldCollation[] collations


protected final RexNode[] fieldExps
Constructor Detail


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

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


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(...);
         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
a clone of this RelNode


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
getChildExps in class AbstractRelNode


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


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