Package org.apache.calcite.plan
Class RelOptAbstractTable
java.lang.Object
org.apache.calcite.plan.RelOptAbstractTable
- All Implemented Interfaces:
RelOptTable
,Wrapper
Partial implementation of
RelOptTable
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.plan.RelOptTable
RelOptTable.ToRelContext, RelOptTable.ViewExpander
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
protected final RelDataType
protected final RelOptSchema
-
Constructor Summary
ModifierConstructorDescriptionprotected
RelOptAbstractTable
(RelOptSchema schema, String name, RelDataType rowType) -
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
.getName()
Obtains an identifier for this table.@Nullable List<RelReferentialConstraint>
Returns the referential constraints existing for this table.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
.<T> @Nullable T
Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Field Details
-
schema
-
rowType
-
name
-
-
Constructor Details
-
RelOptAbstractTable
-
-
Method Details
-
getName
-
getQualifiedName
Description copied from interface:RelOptTable
Obtains an identifier for this table. The identifier must be unique with respect to the Connection producing this table.- Specified by:
getQualifiedName
in interfaceRelOptTable
- Returns:
- qualified name
-
getRowCount
public double getRowCount()Description copied from interface:RelOptTable
Returns an estimate of the number of rows in the table.- Specified by:
getRowCount
in interfaceRelOptTable
-
getRowType
Description copied from interface:RelOptTable
Describes the type of rows returned by this table.- Specified by:
getRowType
in interfaceRelOptTable
-
getRelOptSchema
Description copied from interface:RelOptTable
Returns theRelOptSchema
this table belongs to.- Specified by:
getRelOptSchema
in interfaceRelOptTable
-
getCollationList
Description copied from interface:RelOptTable
Returns a description of the physical ordering (or orderings) of the rows returned from this table.- Specified by:
getCollationList
in interfaceRelOptTable
- See Also:
-
getDistribution
Description copied from interface:RelOptTable
Returns a description of the physical distribution of the rows in this table.- Specified by:
getDistribution
in interfaceRelOptTable
- See Also:
-
unwrap
Description copied from interface:Wrapper
Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface. -
isKey
Description copied from interface:RelOptTable
Returns whether the given columns are a key or a superset of a unique key of this table.- Specified by:
isKey
in interfaceRelOptTable
- Parameters:
columns
- Ordinals of key columns- Returns:
- Whether the given columns are a key or a superset of a key
-
getKeys
Description copied from interface:RelOptTable
Returns a list of unique keys, empty list if no key exist, the result should be consistent withisKey
.- Specified by:
getKeys
in interfaceRelOptTable
-
getReferentialConstraints
Description copied from interface:RelOptTable
Returns the referential constraints existing for this table. These constraints are represented over other tables usingRelReferentialConstraint
nodes.- Specified by:
getReferentialConstraints
in interfaceRelOptTable
-
toRel
Description copied from interface:RelOptTable
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.- Specified by:
toRel
in interfaceRelOptTable
-
getExpression
Description copied from interface:RelOptTable
Generates code for this table.- Specified by:
getExpression
in interfaceRelOptTable
- Parameters:
clazz
- The desired collection class; for exampleQueryable
.- Returns:
- the code for the table, or null if code generation is not supported
-
extend
Description copied from interface:RelOptTable
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.
- Specified by:
extend
in interfaceRelOptTable
-
getColumnStrategies
Description copied from interface:RelOptTable
Returns a list describing how each column is populated. The list has the same number of entries as there are fields, and is immutable.- Specified by:
getColumnStrategies
in interfaceRelOptTable
-