Package org.apache.calcite.plan
Interface RelOptTable
- All Superinterfaces:
Wrapper
- All Known Subinterfaces:
Prepare.PreparingTable
- All Known Implementing Classes:
MockCatalogReader.MockModifiableViewRelOptTable
,MockCatalogReader.MockRelViewTable
,MockCatalogReader.MockTable
,MockCatalogReader.MockViewTable
,MockCatalogReader.MustFilterMockTable
,Prepare.AbstractPreparingTable
,RelOptAbstractTable
,RelOptTableImpl
Represents a relational dataset in a
RelOptSchema
. It has methods to
describe and implement itself.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Contains the context needed to convert a a table into a relational expression.static interface
Can expand a view into relational expressions. -
Method Summary
Modifier and TypeMethodDescriptionextend
(List<RelDataTypeField> extendedFields) Returns a table with the given extra fields.@Nullable List<RelCollation>
Returns a description of the physical ordering (or orderings) of the rows returned from this table.Returns a list describing how each column is populated.@Nullable RelDistribution
Returns a description of the physical distribution of the rows in this table.@Nullable Expression
getExpression
(Class clazz) Generates code for this table.@Nullable List<ImmutableBitSet>
getKeys()
Returns a list of unique keys, empty list if no key exist, the result should be consistent withisKey
.Obtains an identifier for this table.@Nullable List<RelReferentialConstraint>
Returns the referential constraints existing for this table.@Nullable RelOptSchema
Returns theRelOptSchema
this table belongs to.double
Returns an estimate of the number of rows in the table.Describes the type of rows returned by this table.boolean
isKey
(ImmutableBitSet columns) Returns whether the given columns are a key or a superset of a unique key of this table.toRel
(RelOptTable.ToRelContext context) Converts this table into arelational expression
.Methods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrap, unwrapOrThrow
-
Method Details
-
getQualifiedName
Obtains an identifier for this table. The identifier must be unique with respect to the Connection producing this table.- Returns:
- qualified name
-
getRowCount
double getRowCount()Returns an estimate of the number of rows in the table. -
getRowType
RelDataType getRowType()Describes the type of rows returned by this table. -
getRelOptSchema
@Nullable RelOptSchema getRelOptSchema()Returns theRelOptSchema
this table belongs to. -
toRel
Converts this table into arelational expression
.The
planner
calls this method to convert a table into an initial relational expression, generally something abstract, such as aLogicalTableScan
, then optimizes this expression by applyingrules
to transform it into more efficient access methods for this table. -
getCollationList
@Nullable List<RelCollation> getCollationList()Returns a description of the physical ordering (or orderings) of the rows returned from this table.- See Also:
-
getDistribution
@Nullable RelDistribution getDistribution()Returns a description of the physical distribution of the rows in this table.- See Also:
-
isKey
Returns whether the given columns are a key or a superset of a unique key of this table.- Parameters:
columns
- Ordinals of key columns- Returns:
- Whether the given columns are a key or a superset of a key
-
getKeys
@Nullable List<ImmutableBitSet> getKeys()Returns a list of unique keys, empty list if no key exist, the result should be consistent withisKey
. -
getReferentialConstraints
@Nullable List<RelReferentialConstraint> getReferentialConstraints()Returns the referential constraints existing for this table. These constraints are represented over other tables usingRelReferentialConstraint
nodes. -
getExpression
Generates code for this table.- Parameters:
clazz
- The desired collection class; for exampleQueryable
.- Returns:
- the code for the table, or null if code generation is not supported
-
extend
Returns a table with the given extra fields.The extended table includes the fields of this base table plus the extended fields that do not have the same name as a field in the base table.
-
getColumnStrategies
List<ColumnStrategy> getColumnStrategies()Returns a list describing how each column is populated. The list has the same number of entries as there are fields, and is immutable.
-