Package org.apache.calcite.plan
Class SpoolRelOptTable
java.lang.Object
org.apache.calcite.plan.SpoolRelOptTable
- All Implemented Interfaces:
RelOptTable,Wrapper
Implementation of
RelOptTable for temporary spool tables.
This table represents temporary storage used by spool operators during query execution. It's used for planning purposes only and will be converted to appropriate physical operators later.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.plan.RelOptTable
RelOptTable.ToRelContext, RelOptTable.ViewExpander -
Constructor Summary
ConstructorsConstructorDescriptionSpoolRelOptTable(@Nullable RelOptSchema schema, RelDataType rowType, String name, double rowCount) Creates a SpoolRelOptTable with explicit row count. -
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 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.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.booleanisKey(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.<C> @Nullable CFinds 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, waitMethods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Constructor Details
-
SpoolRelOptTable
public SpoolRelOptTable(@Nullable RelOptSchema schema, RelDataType rowType, String name, double rowCount) Creates a SpoolRelOptTable with explicit row count.- Parameters:
schema- the schema this table belongs to (can be null for temporary tables)rowType- the row type of the data that will be stored in this spoolname- optional name for the spool tablerowCount- the estimated number of rows that will be materialized in this spool
-
-
Method Details
-
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.- Specified by:
toRelin interfaceRelOptTable
-
getQualifiedName
Description copied from interface:RelOptTableObtains an identifier for this table. The identifier must be unique with respect to the Connection producing this table.- Specified by:
getQualifiedNamein interfaceRelOptTable- Returns:
- qualified name
-
getRowCount
public double getRowCount()Description copied from interface:RelOptTableReturns an estimate of the number of rows in the table.- Specified by:
getRowCountin interfaceRelOptTable
-
getRowType
Description copied from interface:RelOptTableDescribes the type of rows returned by this table.- Specified by:
getRowTypein interfaceRelOptTable
-
getRelOptSchema
Description copied from interface:RelOptTableReturns theRelOptSchemathis table belongs to.- Specified by:
getRelOptSchemain interfaceRelOptTable
-
getDistribution
Description copied from interface:RelOptTableReturns a description of the physical distribution of the rows in this table.- Specified by:
getDistributionin interfaceRelOptTable- See Also:
-
getKeys
Description copied from interface:RelOptTableReturns a list of unique keys, empty list if no key exist, the result should be consistent withisKey.- Specified by:
getKeysin interfaceRelOptTable
-
getReferentialConstraints
Description copied from interface:RelOptTableReturns the referential constraints existing for this table. These constraints are represented over other tables usingRelReferentialConstraintnodes.- Specified by:
getReferentialConstraintsin interfaceRelOptTable
-
getCollationList
Description copied from interface:RelOptTableReturns a description of the physical ordering (or orderings) of the rows returned from this table.- Specified by:
getCollationListin interfaceRelOptTable- 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.- Specified by:
isKeyin interfaceRelOptTable- Parameters:
columns- Ordinals of key columns- Returns:
- Whether the given columns are a key or a superset of a key
-
getExpression
Description copied from interface:RelOptTableGenerates code for this table.- Specified by:
getExpressionin 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:RelOptTableReturns 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:
extendin interfaceRelOptTable
-
getColumnStrategies
Description copied from interface:RelOptTableReturns 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:
getColumnStrategiesin interfaceRelOptTable
-
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.
-