public class StarTable extends AbstractTable implements TranslatableTable
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.
Modifier and Type | Class and Description |
---|---|
static class |
StarTable.StarTableScan
Relational expression that scans a
StarTable . |
Modifier and Type | Field and Description |
---|---|
ImmutableIntList |
fieldCounts
Number of fields in each table's row type.
|
Lattice |
lattice |
com.google.common.collect.ImmutableList<Table> |
tables |
Modifier | Constructor and Description |
---|---|
private |
StarTable(Lattice lattice,
com.google.common.collect.ImmutableList<Table> tables)
Creates a StarTable.
|
Modifier and Type | Method and Description |
---|---|
StarTable |
add(Table table) |
int |
columnOffset(Table table)
Returns the column offset of the first column of
table in this
star table's output row type. |
Schema.TableType |
getJdbcTableType()
Type of table.
|
RelDataType |
getRowType(RelDataTypeFactory typeFactory)
Returns this table's row type.
|
static StarTable |
of(Lattice lattice,
java.util.List<Table> tables)
Creates a StarTable and registers it in a schema.
|
RelNode |
toRel(RelOptTable.ToRelContext context,
RelOptTable table)
Converts this table into a
relational expression . |
getStatistic, isRolledUp, rolledUpColumnValidInsideAgg, unwrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getStatistic, isRolledUp, rolledUpColumnValidInsideAgg
public final Lattice lattice
public final com.google.common.collect.ImmutableList<Table> tables
public ImmutableIntList fieldCounts
public static StarTable of(Lattice lattice, java.util.List<Table> tables)
public Schema.TableType getJdbcTableType()
Table
getJdbcTableType
in interface Table
getJdbcTableType
in class AbstractTable
public RelDataType getRowType(RelDataTypeFactory typeFactory)
Table
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.
getRowType
in interface Table
typeFactory
- Type factory with which to create the typepublic RelNode toRel(RelOptTable.ToRelContext context, RelOptTable table)
TranslatableTable
relational expression
.toRel
in interface TranslatableTable
public int columnOffset(Table table)
table
in this
star table's output row type.table
- Tablejava.lang.IllegalArgumentException
- if table is not in this starCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.