org.eigenbase.rel
Class TableModificationRelBase

java.lang.Object
  extended by org.eigenbase.rel.AbstractRelNode
      extended by org.eigenbase.rel.SingleRel
          extended by org.eigenbase.rel.TableModificationRelBase
All Implemented Interfaces:
Cloneable, RelNode
Direct Known Subclasses:
MedAbstractFennelTableModRel, TableModificationRel

public abstract class TableModificationRelBase
extends SingleRel

TableModificationRelBase is an abstract base class for implementations of TableModificationRel.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/rel/TableModificationRelBase.java#13 $
Author:
John V. Sichi

Nested Class Summary
static class TableModificationRelBase.Operation
          Enumeration of supported modification operations.
 
Field Summary
protected  RelOptConnection connection
          The connection to the optimizing session.
private  boolean flattened
           
private  RelDataType inputRowType
           
private  TableModificationRelBase.Operation operation
           
protected  RelOptTable table
          The table definition.
private  List<String> updateColumnList
           
 
Fields inherited from class org.eigenbase.rel.AbstractRelNode
digest, id, nextId, rowType, traits
 
Fields inherited from interface org.eigenbase.rel.RelNode
emptyArray
 
Constructor Summary
protected TableModificationRelBase(RelOptCluster cluster, RelTraitSet traits, RelOptTable table, RelOptConnection connection, RelNode child, TableModificationRelBase.Operation operation, List<String> updateColumnList, boolean flattened)
           
 
Method Summary
 RelOptCost computeSelfCost(RelOptPlanner planner)
          Returns the cost of this plan (not including children).
 RelDataType deriveRowType()
           
 void explain(RelOptPlanWriter pw)
           
 RelOptConnection getConnection()
           
 RelDataType getExpectedInputRowType(int ordinalInParent)
          Returns the type of the rows expected for an input.
 TableModificationRelBase.Operation getOperation()
           
 RelOptTable getTable()
          If this relational expression represents an access to a table, returns that table, otherwise returns null.
 List<String> getUpdateColumnList()
           
 boolean isDelete()
           
 boolean isFlattened()
           
 boolean isInsert()
           
 boolean isMerge()
           
 boolean 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
 

Field Detail

connection

protected RelOptConnection connection
The connection to the optimizing session.


table

protected final RelOptTable table
The table definition.


operation

private final TableModificationRelBase.Operation operation

updateColumnList

private final List<String> updateColumnList

inputRowType

private RelDataType inputRowType

flattened

private final boolean flattened
Constructor Detail

TableModificationRelBase

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

getConnection

public RelOptConnection getConnection()

getTable

public RelOptTable getTable()
Description copied from interface: RelNode
If this relational expression represents an access to a table, returns that table, otherwise returns null.

Specified by:
getTable in interface RelNode
Overrides:
getTable in class AbstractRelNode

getUpdateColumnList

public List<String> getUpdateColumnList()

isFlattened

public boolean isFlattened()

getOperation

public TableModificationRelBase.Operation getOperation()

isInsert

public boolean isInsert()

isUpdate

public boolean isUpdate()

isDelete

public boolean isDelete()

isMerge

public boolean isMerge()

deriveRowType

public RelDataType deriveRowType()
Overrides:
deriveRowType in class SingleRel

getExpectedInputRowType

public RelDataType getExpectedInputRowType(int ordinalInParent)
Description copied from interface: RelNode
Returns the type of the rows expected for an input. Defaults to RelNode.getRowType().

Specified by:
getExpectedInputRowType in interface RelNode
Overrides:
getExpectedInputRowType in class AbstractRelNode
Parameters:
ordinalInParent - input's 0-based ordinal with respect to this parent rel
Returns:
expected row type

explain

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

computeSelfCost

public RelOptCost computeSelfCost(RelOptPlanner planner)
Description copied from interface: RelNode
Returns the cost of this plan (not including children). The base implementation throws an error; derived classes should override.

NOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use RelMetadataQuery.getNonCumulativeCost(org.eigenbase.rel.RelNode), which gives plugins a chance to override the rel's default ideas about cost.

Specified by:
computeSelfCost in interface RelNode
Overrides:
computeSelfCost in class AbstractRelNode