Package org.apache.calcite.rel.core
Class TableScan
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.core.TableScan
- All Implemented Interfaces:
Cloneable,RelOptNode,Hintable,RelNode
- Direct Known Subclasses:
Bindables.BindableTableScan,CassandraTableScan,CsvTableScan,CsvTableScan,ElasticsearchTableScan,EnumerableTableScan,GeodeTableScan,InnodbTableScan,JdbcTableScan,LogicalTableScan,MongoTableScan,PigTableScan,SplunkTableScan,StarTable.StarTableScan
Relational operator that returns the contents of a table.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.google.common.collect.ImmutableList<RelHint>The table hints.protected final RelOptTableThe table definition.Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTableScan(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelOptTable table) protectedTableScan(RelOptCluster cluster, RelTraitSet traitSet, RelOptTable table) Deprecated.protectedCreates a TableScan by parsing serialized output. -
Method Summary
Modifier and TypeMethodDescriptionaccept(RelShuttle shuttle) Accepts a visit from a shuttle.@Nullable RelOptCostcomputeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) Returns the cost of this plan (not including children).doubleReturns an estimate of the number of rows this relational expression will return.Describes the inputs and attributes of this relational expression.com.google.common.collect.ImmutableList<RelHint>getHints()Returns the hints of this relational expressions as an immutable list.getTable()If this relational expression represents an access to a table, returns that table, otherwise returns null.identity()Returns an identity projection.static ImmutableIntListidentity(RelOptTable table) Returns an identity projection for the given table.project(ImmutableBitSet fieldsUsed, Set<RelDataTypeField> extraFields, RelBuilder relBuilder) 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.Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, childrenAccept, collectVariablesSet, collectVariablesUsed, copy, deepEquals, deepHashCode, equals, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getInputs, getRelDigest, getRelTypeName, getRowType, getTraitSet, getVariablesSet, hashCode, isEnforcer, isValid, metadata, onRegister, recomputeDigest, register, replaceInput, sole, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.rel.hint.Hintable
attachHints, withHintsMethods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable, stripped
-
Field Details
-
table
The table definition. -
hints
The table hints.
-
-
Constructor Details
-
TableScan
protected TableScan(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelOptTable table) -
TableScan
Deprecated. -
TableScan
Creates a TableScan by parsing serialized output.
-
-
Method Details
-
estimateRowCount
Description copied from interface:RelNodeReturns an estimate of the number of rows this relational expression will return.NOTE 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.- Specified by:
estimateRowCountin interfaceRelNode- Overrides:
estimateRowCountin classAbstractRelNode- Parameters:
mq- Metadata query- Returns:
- Estimate of the number of rows this relational expression will return
-
getTable
Description copied from interface:RelNodeIf this relational expression represents an access to a table, returns that table, otherwise returns null.- Specified by:
getTablein interfaceRelNode- Overrides:
getTablein classAbstractRelNode- Returns:
- If this relational expression represents an access to a table, returns that table, otherwise returns null
-
computeSelfCost
Description copied from interface:RelNodeReturns 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.apache.calcite.rel.RelNode), which gives plugins a chance to override the rel's default ideas about cost.- Specified by:
computeSelfCostin interfaceRelNode- Overrides:
computeSelfCostin classAbstractRelNode- Parameters:
planner- Planner for cost calculationmq- Metadata query- Returns:
- Cost of this plan (not including children)
-
deriveRowType
- Overrides:
deriveRowTypein classAbstractRelNode
-
identity
Returns an identity projection for the given table. -
identity
Returns an identity projection. -
explainTerms
Description copied from class:AbstractRelNodeDescribes the inputs and attributes of this relational expression. Each node should callsuper.explainTerms, then call theRelWriter.input(String, RelNode)andRelWriter.item(String, Object)methods for each input and attribute.- Overrides:
explainTermsin classAbstractRelNode- Parameters:
pw- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
project
public RelNode project(ImmutableBitSet fieldsUsed, Set<RelDataTypeField> extraFields, RelBuilder relBuilder) 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.The default implementation assumes that tables cannot do either of these operations, therefore it adds a
Projectthat projectsNULLvalues for the extra fields, using theRelBuilder.project(Iterable)method.Sub-classes, representing table types that have these capabilities, should override.
- Parameters:
fieldsUsed- Bitmap of the fields desired by the consumerextraFields- Extra fields, not advertised in the table's row-type, wanted by the consumerrelBuilder- Builder used to create a Project- Returns:
- Relational expression that projects the desired fields
-
accept
Description copied from interface:RelNodeAccepts a visit from a shuttle.- Specified by:
acceptin interfaceRelNode- Overrides:
acceptin classAbstractRelNode- Parameters:
shuttle- Shuttle- Returns:
- A copy of this node incorporating changes made by the shuttle to this node's children
-
getHints
Description copied from interface:HintableReturns the hints of this relational expressions as an immutable list.
-