Package org.apache.calcite.plan
Interface RelOptTable
-
- All Superinterfaces:
Wrapper
- All Known Subinterfaces:
Prepare.PreparingTable
- All Known Implementing Classes:
LoptSemiJoinOptimizer.LcsTable
,Prepare.AbstractPreparingTable
,RelOptAbstractTable
,RelOptTableImpl
public interface RelOptTable extends Wrapper
Represents a relational dataset in aRelOptSchema
. It has methods to describe and implement itself.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
RelOptTable.ToRelContext
Contains the context needed to convert a a table into a relational expression.static interface
RelOptTable.ViewExpander
Can expand a view into relational expressions.
-
Method Summary
All Methods Instance Methods Abstract 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.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
.
-
-
-
Method Detail
-
getQualifiedName
java.util.List<java.lang.String> 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
RelOptSchema getRelOptSchema()
Returns theRelOptSchema
this table belongs to.
-
toRel
RelNode toRel(RelOptTable.ToRelContext context)
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
java.util.List<RelCollation> getCollationList()
Returns a description of the physical ordering (or orderings) of the rows returned from this table.- See Also:
RelMetadataQuery.collations(RelNode)
-
getDistribution
RelDistribution getDistribution()
Returns a description of the physical distribution of the rows in this table.- See Also:
RelMetadataQuery.distribution(RelNode)
-
isKey
boolean isKey(ImmutableBitSet columns)
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
-
getReferentialConstraints
java.util.List<RelReferentialConstraint> getReferentialConstraints()
Returns the referential constraints existing for this table. These constraints are represented over other tables usingRelReferentialConstraint
nodes.
-
getExpression
Expression getExpression(java.lang.Class clazz)
Generates code for this table.- Parameters:
clazz
- The desired collection class; for exampleQueryable
.
-
extend
RelOptTable extend(java.util.List<RelDataTypeField> extendedFields)
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
java.util.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.
-
-