public abstract class TableModify extends SingleRel
TableScan,
but represents a request to modify a table rather than read from it.
It takes one child which produces the modified rows. Those rows are:
INSERT, those rows are the new values;
DELETE, the old values;
UPDATE, all old values plus updated new values.
| Modifier and Type | Class and Description |
|---|---|
static class |
TableModify.Operation
Enumeration of supported modification operations.
|
| Modifier and Type | Field and Description |
|---|---|
protected Prepare.CatalogReader |
catalogReader
The connection to the optimizing session.
|
protected RelOptTable |
table
The table definition.
|
digest, id, rowType, traitSet| Modifier | Constructor and Description |
|---|---|
protected |
TableModify(RelOptCluster cluster,
RelTraitSet traits,
RelOptTable table,
Prepare.CatalogReader catalogReader,
RelNode child,
TableModify.Operation operation,
List<String> updateColumnList,
boolean flattened) |
| Modifier and Type | Method and Description |
|---|---|
RelOptCost |
computeSelfCost(RelOptPlanner planner)
Returns the cost of this plan (not including children).
|
RelDataType |
deriveRowType() |
RelWriter |
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.
|
Prepare.CatalogReader |
getCatalogReader() |
RelDataType |
getExpectedInputRowType(int ordinalInParent)
Returns the type of the rows expected for an input.
|
TableModify.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() |
childrenAccept, getInput, getInputs, getRows, replaceInputaccept, accept, collectVariablesSet, collectVariablesUsed, computeDigest, copy, explain, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getId, getInput, getQuery, getRelTypeName, getRowType, getTraitSet, getVariablesStopped, isDistinct, isKey, isValid, metadata, onRegister, recomputeDigest, register, sole, toStringprotected Prepare.CatalogReader catalogReader
protected final RelOptTable table
protected TableModify(RelOptCluster cluster, RelTraitSet traits, RelOptTable table, Prepare.CatalogReader catalogReader, RelNode child, TableModify.Operation operation, List<String> updateColumnList, boolean flattened)
public Prepare.CatalogReader getCatalogReader()
public RelOptTable getTable()
RelNodegetTable in interface RelNodegetTable in class AbstractRelNodepublic boolean isFlattened()
public TableModify.Operation getOperation()
public boolean isInsert()
public boolean isUpdate()
public boolean isDelete()
public boolean isMerge()
public RelDataType deriveRowType()
deriveRowType in class SingleRelpublic RelDataType getExpectedInputRowType(int ordinalInParent)
RelNodeRelNode.getRowType().getExpectedInputRowType in interface RelNodegetExpectedInputRowType in class AbstractRelNodeordinalInParent - input's 0-based ordinal with respect to this
parent relpublic RelWriter explainTerms(RelWriter pw)
AbstractRelNodesuper.explainTerms, then call the
RelWriterImpl.input(String, RelNode)
and
RelWriterImpl.item(String, Object)
methods for each input and attribute.explainTerms in class SingleRelpw - Plan writerpublic RelOptCost computeSelfCost(RelOptPlanner planner)
RelNodeNOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getNonCumulativeCost(org.apache.calcite.rel.RelNode), which gives plugins a
chance to override the rel's default ideas about cost.
computeSelfCost in interface RelNodecomputeSelfCost in class AbstractRelNodeplanner - Planner for cost calculationCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.