Package org.apache.calcite.schema.impl
Class StarTable
java.lang.Object
org.apache.calcite.schema.impl.AbstractTable
org.apache.calcite.schema.impl.StarTable
- All Implemented Interfaces:
Table
,TranslatableTable
,Wrapper
Virtual table that is composed of two or more tables joined together.
Star tables do not occur in end-user queries. They are introduced by the optimizer to help matching queries to materializations, and used only during the planning process.
When a materialization is defined, if it involves a join, it is converted to a query on top of a star table. Queries that are candidates to map onto the materialization are mapped onto the same star table.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescription@MonotonicNonNull ImmutableIntList
Number of fields in each table's row type.final Lattice
final com.google.common.collect.ImmutableList<Table>
-
Method Summary
Modifier and TypeMethodDescriptionint
columnOffset
(Table table) Returns the column offset of the first column oftable
in this star table's output row type.Type of table.getRowType
(RelDataTypeFactory typeFactory) Returns this table's row type.static StarTable
Creates a StarTable and registers it in a schema.toRel
(RelOptTable.ToRelContext context, RelOptTable table) Converts this table into arelational expression
.Methods inherited from class org.apache.calcite.schema.impl.AbstractTable
getStatistic, isRolledUp, rolledUpColumnValidInsideAgg, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.calcite.schema.Table
getStatistic, isRolledUp, rolledUpColumnValidInsideAgg
Methods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Field Details
-
lattice
-
tables
-
fieldCounts
Number of fields in each table's row type.
-
-
Method Details
-
of
Creates a StarTable and registers it in a schema. -
getJdbcTableType
Description copied from interface:Table
Type of table.- Specified by:
getJdbcTableType
in interfaceTable
- Overrides:
getJdbcTableType
in classAbstractTable
-
getRowType
Description copied from interface:Table
Returns this table's row type.This is a struct type whose fields describe the names and types of the columns in this table.
The implementer must use the type factory provided. This ensures that the type is converted into a canonical form; other equal types in the same query will use the same object.
- Specified by:
getRowType
in interfaceTable
- Parameters:
typeFactory
- Type factory with which to create the type- Returns:
- Row type
-
toRel
Description copied from interface:TranslatableTable
Converts this table into arelational expression
.- Specified by:
toRel
in interfaceTranslatableTable
-
add
-
columnOffset
Returns the column offset of the first column oftable
in this star table's output row type.- Parameters:
table
- Table- Returns:
- Column offset
- Throws:
IllegalArgumentException
- if table is not in this star
-