Package org.apache.calcite.plan
Class RelOptAbstractTable
- java.lang.Object
-
- org.apache.calcite.plan.RelOptAbstractTable
-
- All Implemented Interfaces:
RelOptTable
,Wrapper
public abstract class RelOptAbstractTable extends java.lang.Object implements RelOptTable
Partial implementation ofRelOptTable
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.plan.RelOptTable
RelOptTable.ToRelContext, RelOptTable.ViewExpander
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
name
protected RelDataType
rowType
protected RelOptSchema
schema
-
Constructor Summary
Constructors Modifier Constructor Description protected
RelOptAbstractTable(RelOptSchema schema, java.lang.String name, RelDataType rowType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RelOptTable
extend(java.util.List<RelDataTypeField> extendedFields)
Returns a table with the given extra fields.java.util.List<RelCollation>
getCollationList()
Returns a description of the physical ordering (or orderings) of the rows returned from this table.java.util.List<ColumnStrategy>
getColumnStrategies()
Returns a list describing how each column is populated.RelDistribution
getDistribution()
Returns a description of the physical distribution of the rows in this table.Expression
getExpression(java.lang.Class clazz)
Generates code for this table.java.lang.String
getName()
java.util.List<java.lang.String>
getQualifiedName()
Obtains an identifier for this table.java.util.List<RelReferentialConstraint>
getReferentialConstraints()
Returns the referential constraints existing for this table.RelOptSchema
getRelOptSchema()
Returns theRelOptSchema
this table belongs to.double
getRowCount()
Returns an estimate of the number of rows in the table.RelDataType
getRowType()
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.RelNode
toRel(RelOptTable.ToRelContext context)
Converts this table into arelational expression
.<T> T
unwrap(java.lang.Class<T> clazz)
Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface.
-
-
-
Field Detail
-
schema
protected final RelOptSchema schema
-
rowType
protected final RelDataType rowType
-
name
protected final java.lang.String name
-
-
Constructor Detail
-
RelOptAbstractTable
protected RelOptAbstractTable(RelOptSchema schema, java.lang.String name, RelDataType rowType)
-
-
Method Detail
-
getName
public java.lang.String getName()
-
getQualifiedName
public java.util.List<java.lang.String> 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
public RelDataType getRowType()
Description copied from interface:RelOptTable
Describes the type of rows returned by this table.- Specified by:
getRowType
in interfaceRelOptTable
-
getRelOptSchema
public RelOptSchema getRelOptSchema()
Description copied from interface:RelOptTable
Returns theRelOptSchema
this table belongs to.- Specified by:
getRelOptSchema
in interfaceRelOptTable
-
getCollationList
public java.util.List<RelCollation> 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:
RelMetadataQuery.collations(RelNode)
-
getDistribution
public RelDistribution 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:
RelMetadataQuery.distribution(RelNode)
-
unwrap
public <T> T unwrap(java.lang.Class<T> clazz)
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
public boolean isKey(ImmutableBitSet columns)
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
-
getReferentialConstraints
public java.util.List<RelReferentialConstraint> 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
public RelNode toRel(RelOptTable.ToRelContext context)
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
public Expression getExpression(java.lang.Class clazz)
Description copied from interface:RelOptTable
Generates code for this table.- Specified by:
getExpression
in interfaceRelOptTable
- Parameters:
clazz
- The desired collection class; for exampleQueryable
.
-
extend
public RelOptTable extend(java.util.List<RelDataTypeField> extendedFields)
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
public java.util.List<ColumnStrategy> 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
-
-