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 RelOptTableImplcreate(@Nullable RelOptSchema schema, RelDataType rowType, List<String> names, Expression expression) static RelOptTableImplcreate(@Nullable RelOptSchema schema, RelDataType rowType, List<String> names, Table table, Expression expression) Deprecated.static RelOptTableImplcreate(@Nullable RelOptSchema schema, RelDataType rowType, List<String> names, Table table, TableExpressionFactory expressionFactory) CreatesRelOptTableImplinstance with specified arguments and row count obtained from table statistic.static RelOptTableImplcreate(@Nullable RelOptSchema schema, RelDataType rowType, CalciteSchema.TableEntry tableEntry, @Nullable Double rowCount) static RelOptTableImplcreate(@Nullable RelOptSchema schema, RelDataType rowType, Table table, com.google.common.collect.ImmutableList<String> names) static RelOptTableImplcreate(@Nullable RelOptSchema schema, RelDataType rowType, Table table, Path path) booleanprotected RelOptTableImplementation-specific code to instantiate a newRelOptTablebased on aTablethat 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 RelDistributionReturns a description of the physical distribution of the rows in this table.@Nullable ExpressiongetExpression(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 RelOptSchemaReturns theRelOptSchemathis table belongs to.doubleReturns an estimate of the number of rows in the table.Describes the type of rows returned by this table.inthashCode()booleanisKey(ImmutableBitSet columns) Returns whether the given columns are a key or a superset of a unique key of this table.booleanReturns whether the table is temporal.static intrealOrdinal(RelOptTable table, int i) Converts the ordinal of a field into the ordinal of a stored field.static RelDataTyperealRowType(RelOptTable table) Returns the row type of a table after anyColumnStrategy.VIRTUALcolumns have been removed.booleansupportsModality(SqlModality modality) toRel(RelOptTable.ToRelContext context) Converts this table into arelational expression.toString()<T> @Nullable TFinds 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, getColumnStrategiesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.sql.validate.SqlValidatorTable
tableMethods 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) CreatesRelOptTableImplinstance 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:
RelOptTableImplinstance
-
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:WrapperFinds 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:RelOptTableGenerates 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.AbstractPreparingTableImplementation-specific code to instantiate a newRelOptTablebased on aTablethat has been extended.- Specified by:
extendin classPrepare.AbstractPreparingTable
-
equals
-
hashCode
public int hashCode() -
getRowCount
public double getRowCount()Description copied from interface:RelOptTableReturns an estimate of the number of rows in the table. -
getRelOptSchema
Description copied from interface:RelOptTableReturns theRelOptSchemathis table belongs to. -
toRel
Description copied from interface:RelOptTableConverts this table into arelational expression.The
plannercalls this method to convert a table into an initial relational expression, generally something abstract, such as aLogicalTableScan, then optimizes this expression by applyingrulesto transform it into more efficient access methods for this table. -
getCollationList
Description copied from interface:RelOptTableReturns a description of the physical ordering (or orderings) of the rows returned from this table.- See Also:
-
getDistribution
Description copied from interface:RelOptTableReturns a description of the physical distribution of the rows in this table.- See Also:
-
isKey
Description copied from interface:RelOptTableReturns 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:RelOptTableReturns a list of unique keys, empty list if no key exist, the result should be consistent withisKey. -
getReferentialConstraints
Description copied from interface:RelOptTableReturns the referential constraints existing for this table. These constraints are represented over other tables usingRelReferentialConstraintnodes. -
getRowType
Description copied from interface:RelOptTableDescribes the type of rows returned by this table. -
supportsModality
-
isTemporal
public boolean isTemporal()Description copied from interface:SqlValidatorTableReturns whether the table is temporal. -
getQualifiedName
Description copied from interface:RelOptTableObtains 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:SqlValidatorTableReturns whether a given column is monotonic. -
getAllowedAccess
Description copied from interface:SqlValidatorTableReturns 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.VIRTUALcolumns have been removed. This is the type of the records that are actually stored.
-