Package org.apache.calcite.prepare
Class RelOptTableImpl
java.lang.Object
org.apache.calcite.prepare.Prepare.AbstractPreparingTable
org.apache.calcite.prepare.RelOptTableImpl
- All Implemented Interfaces:
RelOptTable
,Prepare.PreparingTable
,Wrapper
,SqlValidatorTable
Implementation of
RelOptTable
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.plan.RelOptTable
RelOptTable.ToRelContext, RelOptTable.ViewExpander
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<ColumnStrategy>
columnStrategies
(RelOptTable table) copy
(RelDataType newRowType) Creates a copy of this RelOptTable.static RelOptTableImpl
create
(@Nullable RelOptSchema schema, RelDataType rowType, List<String> names, Expression expression) static RelOptTableImpl
create
(@Nullable RelOptSchema schema, RelDataType rowType, List<String> names, Table table, Expression expression) Deprecated.static RelOptTableImpl
create
(@Nullable RelOptSchema schema, RelDataType rowType, List<String> names, Table table, TableExpressionFactory expressionFactory) CreatesRelOptTableImpl
instance with specified arguments and row count obtained from table statistic.static RelOptTableImpl
create
(@Nullable RelOptSchema schema, RelDataType rowType, CalciteSchema.TableEntry tableEntry, @Nullable Double rowCount) static RelOptTableImpl
create
(@Nullable RelOptSchema schema, RelDataType rowType, Table table, com.google.common.collect.ImmutableList<String> names) static RelOptTableImpl
create
(@Nullable RelOptSchema schema, RelDataType rowType, Table table, Path path) boolean
protected RelOptTable
Implementation-specific code to instantiate a newRelOptTable
based on aTable
that has been extended.Returns the access type of the table.@Nullable List<RelCollation>
Returns a description of the physical ordering (or orderings) of the rows returned from this table.@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
.getMonotonicity
(String columnName) Returns whether a given column is monotonic.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.int
hashCode()
boolean
isKey
(ImmutableBitSet columns) Returns whether the given columns are a key or a superset of a unique key of this table.boolean
Returns whether the table is temporal.static int
realOrdinal
(RelOptTable table, int i) Converts the ordinal of a field into the ordinal of a stored field.static RelDataType
realRowType
(RelOptTable table) Returns the row type of a table after anyColumnStrategy.VIRTUAL
columns have been removed.boolean
supportsModality
(SqlModality modality) toRel
(RelOptTable.ToRelContext context) Converts this table into arelational expression
.toString()
<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 org.apache.calcite.prepare.Prepare.AbstractPreparingTable
columnHasDefaultValue, extend, getColumnStrategies
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.calcite.sql.validate.SqlValidatorTable
table
Methods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Method Details
-
create
public static RelOptTableImpl create(@Nullable RelOptSchema schema, RelDataType rowType, List<String> names, Expression expression) -
create
@Deprecated public static RelOptTableImpl create(@Nullable RelOptSchema schema, RelDataType rowType, List<String> names, Table table, Expression expression) Deprecated. -
create
public static RelOptTableImpl create(@Nullable RelOptSchema schema, RelDataType rowType, List<String> names, Table table, TableExpressionFactory expressionFactory) CreatesRelOptTableImpl
instance with specified arguments and row count obtained from table statistic.- Parameters:
schema
- table schemarowType
- table row typenames
- full table pathtable
- tableexpressionFactory
- expression function for accessing table data in the generated code- Returns:
RelOptTableImpl
instance
-
create
public static RelOptTableImpl create(@Nullable RelOptSchema schema, RelDataType rowType, Table table, Path path) -
create
public static RelOptTableImpl create(@Nullable RelOptSchema schema, RelDataType rowType, CalciteSchema.TableEntry tableEntry, @Nullable Double rowCount) -
copy
Creates a copy of this RelOptTable. The new RelOptTable will have newRowType. -
toString
-
create
public static RelOptTableImpl create(@Nullable RelOptSchema schema, RelDataType rowType, Table table, com.google.common.collect.ImmutableList<String> names) -
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. -
getExpression
Description copied from interface:RelOptTable
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
Description copied from class:Prepare.AbstractPreparingTable
Implementation-specific code to instantiate a newRelOptTable
based on aTable
that has been extended.- Specified by:
extend
in classPrepare.AbstractPreparingTable
-
equals
-
hashCode
public int hashCode() -
getRowCount
public double getRowCount()Description copied from interface:RelOptTable
Returns an estimate of the number of rows in the table. -
getRelOptSchema
Description copied from interface:RelOptTable
Returns theRelOptSchema
this table belongs to. -
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. -
getCollationList
Description copied from interface:RelOptTable
Returns a description of the physical ordering (or orderings) of the rows returned from this table.- See Also:
-
getDistribution
Description copied from interface:RelOptTable
Returns a description of the physical distribution of the rows in this table.- See Also:
-
isKey
Description copied from interface:RelOptTable
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
Description copied from interface:RelOptTable
Returns a list of unique keys, empty list if no key exist, the result should be consistent withisKey
. -
getReferentialConstraints
Description copied from interface:RelOptTable
Returns the referential constraints existing for this table. These constraints are represented over other tables usingRelReferentialConstraint
nodes. -
getRowType
Description copied from interface:RelOptTable
Describes the type of rows returned by this table. -
supportsModality
-
isTemporal
public boolean isTemporal()Description copied from interface:SqlValidatorTable
Returns whether the table is temporal. -
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.- Returns:
- qualified name
-
getMonotonicity
Description copied from interface:SqlValidatorTable
Returns whether a given column is monotonic. -
getAllowedAccess
Description copied from interface:SqlValidatorTable
Returns the access type of the table. -
columnStrategies
-
realOrdinal
Converts the ordinal of a field into the ordinal of a stored field. That is, it subtracts the number of virtual fields that come before it. -
realRowType
Returns the row type of a table after anyColumnStrategy.VIRTUAL
columns have been removed. This is the type of the records that are actually stored.
-