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 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,
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. |
getStatisticclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetStatisticpublic final Lattice lattice
public final com.google.common.collect.ImmutableList<Table> tables
public ImmutableIntList fieldCounts
public static StarTable of(Lattice lattice, List<Table> tables)
public Schema.TableType getJdbcTableType()
TablegetJdbcTableType in interface TablegetJdbcTableType in class AbstractTablepublic RelDataType getRowType(RelDataTypeFactory typeFactory)
TableThis 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 TabletypeFactory - Type factory with which to create the typepublic RelNode toRel(RelOptTable.ToRelContext context, RelOptTable table)
TranslatableTablerelational expression.toRel in interface TranslatableTablepublic int columnOffset(Table table)
table in this
star table's output row type.table - TableIllegalArgumentException - if table is not in this starCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.