org.eigenbase.rel.convert
Interface ConverterRel

All Superinterfaces:
Cloneable, RelNode
All Known Implementing Classes:
AbstractConverter, ConverterRelImpl, FennelToIteratorConverter, IteratorToFennelConverter, NoneConverterRel, ResultSetToFarragoIteratorConverter, VolcanoPlannerTest.PhysToIteratorConverter, VolcanoPlannerTraitTest.AltTraitConverter, VolcanoPlannerTraitTest.PhysToIteratorConverter

public interface ConverterRel
extends RelNode

A relational expression implements the interface ConverterRel to indicate that it converts a physical attribute, or trait, of a relational expression from one value to another.

A typical example of a trait is calling convention, and FennelToIteratorConverter is an example of a relational expression which converts that trait.

Sometimes this conversion is expensive; for example, to convert a non-distinct to a distinct object stream, we have to clone every object in the input.

A converter does not change the logical expression being evaluated; after conversion, the number of rows and the values of those rows will still be the same. By declaring itself to be a converter, a relational expression is telling the planner about this equivalence, and the planner groups expressions which are logically equivalent but have different physical traits into groups called RelSets.

In principle one could devise converters which change multiple traits simultaneously (say change the sort-order and the physical location of a relational expression). In which case, the method getInputTraits() would return a RelTraitSet. But for simplicity, this class only allows one trait to be converted at a time; all other traits are assumed to be preserved.

Since:
Dec 12, 2007
Version:
$Id: //open/dev/farrago/src/org/eigenbase/rel/convert/ConverterRel.java#18 $
Author:
jhyde

Field Summary
 
Fields inherited from interface org.eigenbase.rel.RelNode
emptyArray
 
Method Summary
 RelNode getChild()
          Returns the sole input relational expression
 RelTraitSet getInputTraits()
          Returns the trait of the input relational expression.
 RelTraitDef getTraitDef()
          Returns the definition of trait which this converter works on.
 
Methods inherited from interface org.eigenbase.rel.RelNode
childrenAccept, clone, collectVariablesSet, collectVariablesUsed, computeSelfCost, explain, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getInputs, getOrCreateCorrelVariable, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraits, getVariablesStopped, isAccessTo, isDistinct, isValid, onRegister, recomputeDigest, registerCorrelVariable, replaceInput, setCorrelVariable
 

Method Detail

getInputTraits

RelTraitSet getInputTraits()
Returns the trait of the input relational expression.

Returns:
input trait

getTraitDef

RelTraitDef getTraitDef()
Returns the definition of trait which this converter works on.

The input relational expression (matched by the rule) must possess this trait and have the value given by getInputTraits(), and the traits of the output of this converter given by RelNode.getTraits() will have one trait altered and the other orthogonal traits will be the same.

Returns:
trait which this converter modifies

getChild

RelNode getChild()
Returns the sole input relational expression

Returns:
child relational expression