net.sf.farrago.fennel.rel
Class FennelValuesRel

java.lang.Object
  extended by org.eigenbase.rel.AbstractRelNode
      extended by org.eigenbase.rel.ValuesRelBase
          extended by net.sf.farrago.fennel.rel.FennelValuesRel
All Implemented Interfaces:
Cloneable, FennelRel, RelNode

public class FennelValuesRel
extends ValuesRelBase
implements FennelRel

FennelValuesRel is Fennel implementation of ValuesRel. It corresponds to fennel::ValuesExecStream via FemValuesStreamDef, and guarantees the order of the tuples it produces, making it usable for such purposes as the search input to an index scan, where order may matter for both performance and correctness.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/fennel/rel/FennelValuesRel.java#1 $
Author:
John V. Sichi

Field Summary
private  boolean isVisibleInExplain
           
 
Fields inherited from class org.eigenbase.rel.ValuesRelBase
tuples
 
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
FennelValuesRel(RelOptCluster cluster, RelDataType rowType, List<List<RexLiteral>> tuples)
          Creates a new FennelValuesRel.
FennelValuesRel(RelOptCluster cluster, RelDataType rowType, List<List<RexLiteral>> tuples, boolean isVisibleInExplain)
          Creates a new FennelValuesRel.
 
Method Summary
 RelFieldCollation[] getCollations()
          TODO: jhyde, 2006/3/28: unify with RelNode.getCollationList()
 Object implementFennelChild(FennelRelImplementor implementor)
          Visits this relational expression as part of the implementation process.
 boolean isVisibleInExplain()
           
 FemExecutionStreamDef toStreamDef(FennelRelImplementor implementor)
          Converts this relational expression to FemExecutionStreamDef form.
 
Methods inherited from class org.eigenbase.rel.ValuesRelBase
clone, computeSelfCost, deriveRowType, explain, getRows, getTuples
 
Methods inherited from class org.eigenbase.rel.AbstractRelNode
childrenAccept, cloneTraits, collectVariablesSet, collectVariablesUsed, computeDigest, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getInputs, getOrCreateCorrelVariable, getQuery, getRelTypeName, getRowType, getTable, getTraits, getVariablesStopped, inheritTraitsFrom, isAccessTo, isDistinct, isValid, onRegister, recomputeDigest, register, registerCorrelVariable, replaceInput, setCorrelVariable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
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
 

Field Detail

isVisibleInExplain

private final boolean isVisibleInExplain
Constructor Detail

FennelValuesRel

public FennelValuesRel(RelOptCluster cluster,
                       RelDataType rowType,
                       List<List<RexLiteral>> tuples,
                       boolean isVisibleInExplain)
Creates a new FennelValuesRel. Note that tuples passed in become owned by this rel (without a deep copy), so caller must not modify them after this call, otherwise bad things will happen.

Parameters:
cluster - .
rowType - row type for tuples produced by this rel
tuples - 2-dimensional array of tuple values to be produced; outer list contains tuples; each inner list is one tuple; all tuples must be of same length, conforming to rowType
isVisibleInExplain - whether the RelNode should appear in the explain output

FennelValuesRel

public FennelValuesRel(RelOptCluster cluster,
                       RelDataType rowType,
                       List<List<RexLiteral>> tuples)
Creates a new FennelValuesRel. Note that tuples passed in become owned by this rel (without a deep copy), so caller must not modify them after this call, otherwise bad things will happen.

Parameters:
cluster - .
rowType - row type for tuples produced by this rel
tuples - 2-dimensional array of tuple values to be produced; outer list contains tuples; each inner list is one tuple; all tuples must be of same length, conforming to rowType
Method Detail

toStreamDef

public FemExecutionStreamDef toStreamDef(FennelRelImplementor implementor)
Description copied from interface: FennelRel
Converts this relational expression to FemExecutionStreamDef form. In the process, the relational expression will almost certainly call FennelRelImplementor.visitFennelChild(net.sf.farrago.query.FennelRel, int) on each of its children.

Specified by:
toStreamDef in interface FennelRel
Parameters:
implementor - for generating Java code
Returns:
generated FemExecutionStreamDef

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

getCollations

public RelFieldCollation[] getCollations()
Description copied from interface: FennelRel

TODO: jhyde, 2006/3/28: unify with RelNode.getCollationList()

Specified by:
getCollations in interface FennelRel
Returns:
the sort order produced by this FennelRel, or an empty array if the output is not guaranteed to be in any particular order.

isVisibleInExplain

public boolean isVisibleInExplain()