net.sf.farrago.namespace.impl
Class MedAbstractFennelTableModRel

java.lang.Object
  extended by org.eigenbase.rel.AbstractRelNode
      extended by org.eigenbase.rel.SingleRel
          extended by org.eigenbase.rel.TableModificationRelBase
              extended by net.sf.farrago.namespace.impl.MedAbstractFennelTableModRel
All Implemented Interfaces:
Cloneable, FennelRel, RelNode
Direct Known Subclasses:
FtrsTableModificationRel, LcsTableAppendRel, LcsTableDeleteRel, LcsTableMergeRel

public abstract class MedAbstractFennelTableModRel
extends TableModificationRelBase
implements FennelRel

MedAbstractFennelTableModRel refines TableModificationRelBase. It is also an abstract base class for implementations of the FennelRel interface.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/namespace/impl/MedAbstractFennelTableModRel.java#15 $
Author:
Rushan Chen

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eigenbase.rel.TableModificationRelBase
TableModificationRelBase.Operation
 
Field Summary
 
Fields inherited from class org.eigenbase.rel.TableModificationRelBase
connection, table
 
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
MedAbstractFennelTableModRel(RelOptCluster cluster, RelTraitSet traits, RelOptTable table, RelOptConnection connection, RelNode child, TableModificationRelBase.Operation operation, List<String> updateColumnList, boolean flattened)
           
 
Method Summary
 RelFieldCollation[] getCollations()
          TODO: jhyde, 2006/3/28: unify with RelNode.getCollationList()
 RelOptConnection getConnection()
           
 FarragoTypeFactory getFarragoTypeFactory()
           
 Object implementFennelChild(FennelRelImplementor implementor)
          Visits this relational expression as part of the implementation process.
 boolean inputNeedBuffer()
          Test if input needs to be buffered.
 boolean inputNeedBuffer(RelNode input)
           
private  boolean isIndexRootSelfReferencing(CwmTable cwmTable)
           
private  boolean isTableAccessedForRead()
           
 FemBufferingTupleStreamDef newInputBuffer(FarragoRepos repos)
          Create a new buffering stream def based on input tuple format.
 
Methods inherited from class org.eigenbase.rel.TableModificationRelBase
computeSelfCost, deriveRowType, explain, getExpectedInputRowType, getOperation, getTable, getUpdateColumnList, isDelete, isFlattened, isInsert, isMerge, isUpdate
 
Methods inherited from class org.eigenbase.rel.SingleRel
childrenAccept, getChild, getInputs, getRows, replaceInput
 
Methods inherited from class org.eigenbase.rel.AbstractRelNode
clone, cloneTraits, collectVariablesSet, collectVariablesUsed, computeDigest, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getId, getInput, getOrCreateCorrelVariable, getQuery, getRelTypeName, getRowType, 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
 
Methods inherited from interface net.sf.farrago.query.FennelRel
toStreamDef
 
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
 

Constructor Detail

MedAbstractFennelTableModRel

public MedAbstractFennelTableModRel(RelOptCluster cluster,
                                    RelTraitSet traits,
                                    RelOptTable table,
                                    RelOptConnection connection,
                                    RelNode child,
                                    TableModificationRelBase.Operation operation,
                                    List<String> updateColumnList,
                                    boolean flattened)
Method Detail

getConnection

public RelOptConnection getConnection()
Overrides:
getConnection in class TableModificationRelBase

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.

getFarragoTypeFactory

public FarragoTypeFactory getFarragoTypeFactory()

inputNeedBuffer

public boolean inputNeedBuffer()
Test if input needs to be buffered.

Returns:
true if input to this TableModificationRelBase needs to be buffered.

inputNeedBuffer

public boolean inputNeedBuffer(RelNode input)

isTableAccessedForRead

private boolean isTableAccessedForRead()
Returns:
whether the table to be modified is also accessed for reading

isIndexRootSelfReferencing

private boolean isIndexRootSelfReferencing(CwmTable cwmTable)
Returns:
for a table modification that is self referencing (i.e. same table is accessed for both input and output), determines whether any index roots will be accessed for both input and output. In the case of insertions, the deletion index is not taken into account, because insertions produce no deleted entries.

newInputBuffer

public FemBufferingTupleStreamDef newInputBuffer(FarragoRepos repos)
Create a new buffering stream def based on input tuple format.

Parameters:
repos - repos storing object definitions.
Returns:
the newly constructed FemBufferingTupleStreamDef.