public abstract class TableScan extends AbstractRelNode
| Modifier and Type | Field and Description |
|---|---|
protected RelOptTable |
table
The table definition.
|
digest, id, rowType, traitSet| Modifier | Constructor and Description |
|---|---|
protected |
TableScan(RelInput input)
Creates a TableScan by parsing serialized output.
|
protected |
TableScan(RelOptCluster cluster,
RelTraitSet traitSet,
RelOptTable table) |
| Modifier and Type | Method and Description |
|---|---|
RelNode |
accept(RelShuttle shuttle)
Accepts a visit from a shuttle.
|
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.
|
List<RelCollation> |
getCollationList()
Returns a description of the physical ordering (or orderings) of this
relational expression.
|
double |
getRows()
Returns an estimate of the number of rows this relational expression will
return.
|
RelOptTable |
getTable()
If this relational expression represents an access to a table, returns
that table, otherwise returns null.
|
ImmutableIntList |
identity()
Returns an identity projection.
|
static ImmutableIntList |
identity(RelOptTable table)
Returns an identity projection for the given table.
|
boolean |
isKey(ImmutableBitSet columns)
Returns whether the result of this relational expression is uniquely
identified by this columns with the given ordinals.
|
RelNode |
project(ImmutableBitSet fieldsUsed,
Set<RelDataTypeField> extraFields,
RelFactories.ProjectFactory projectFactory)
Projects a subset of the fields of the table, and also asks for "extra"
fields that were not included in the table's official type.
|
accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeDigest, copy, explain, getChildExps, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getInputs, getQuery, getRelTypeName, getRowType, getTraitSet, getVariablesStopped, isDistinct, isValid, metadata, onRegister, recomputeDigest, register, replaceInput, sole, toStringprotected final RelOptTable table
protected TableScan(RelOptCluster cluster, RelTraitSet traitSet, RelOptTable table)
protected TableScan(RelInput input)
public double getRows()
RelNodeNOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getRowCount(org.apache.calcite.rel.RelNode), which gives plugins a chance to
override the rel's default ideas about row count.
getRows in interface RelNodegetRows in class AbstractRelNodepublic RelOptTable getTable()
RelNodegetTable in interface RelNodegetTable in class AbstractRelNodepublic List<RelCollation> getCollationList()
RelNodegetCollationList in interface RelNodegetCollationList in class AbstractRelNodepublic boolean isKey(ImmutableBitSet columns)
RelNodeFor example, if this relational expression is a LogicalTableScan to T(A, B, C, D) whose key is (A, B), then isKey([0, 1]) yields true, and isKey([0]) and isKey([0, 2]) yields false.
isKey in interface RelNodeisKey in class AbstractRelNodecolumns - Ordinals of key columnspublic 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 calculationpublic RelDataType deriveRowType()
deriveRowType in class AbstractRelNodepublic static ImmutableIntList identity(RelOptTable table)
public ImmutableIntList identity()
public 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 AbstractRelNodepw - Plan writerpublic RelNode project(ImmutableBitSet fieldsUsed, Set<RelDataTypeField> extraFields, RelFactories.ProjectFactory projectFactory)
The default implementation assumes that tables cannot do either of
these operations, therefore it adds a
LogicalProject, projecting
NULL values for the extra fields.
Sub-classes, representing table types that have these capabilities, should override.
fieldsUsed - Bitmap of the fields desired by the consumerextraFields - Extra fields, not advertised in the table's row-type,
wanted by the consumerpublic RelNode accept(RelShuttle shuttle)
RelNodeaccept in interface RelNodeaccept in class AbstractRelNodeshuttle - ShuttleCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.