public class RelOptTableImpl extends Prepare.AbstractPreparingTable
RelOptTable.| Modifier and Type | Class and Description |
|---|---|
private static class |
RelOptTableImpl.MySchemaPlus
Implementation of
SchemaPlus that wraps a regular schema and knows
its name and parent. |
RelOptTable.ToRelContext, RelOptTable.ViewExpander| Modifier and Type | Field and Description |
|---|---|
private com.google.common.base.Function<Class,Expression> |
expressionFunction |
private com.google.common.collect.ImmutableList<String> |
names |
private Double |
rowCount
Estimate for the row count, or null.
|
private RelDataType |
rowType |
private RelOptSchema |
schema |
private Table |
table |
| Modifier | Constructor and Description |
|---|---|
private |
RelOptTableImpl(RelOptSchema schema,
RelDataType rowType,
List<String> names,
Table table,
com.google.common.base.Function<Class,Expression> expressionFunction,
Double rowCount) |
| Modifier and Type | Method and Description |
|---|---|
static List<ColumnStrategy> |
columnStrategies(RelOptTable table)
|
RelOptTableImpl |
copy(RelDataType newRowType)
Creates a copy of this RelOptTable.
|
static RelOptTableImpl |
create(RelOptSchema schema,
RelDataType rowType,
CalciteSchema.TableEntry tableEntry,
Double rowCount) |
static RelOptTableImpl |
create(RelOptSchema schema,
RelDataType rowType,
List<String> names,
Expression expression) |
static RelOptTableImpl |
create(RelOptSchema schema,
RelDataType rowType,
Table table,
com.google.common.collect.ImmutableList<String> names) |
static RelOptTableImpl |
create(RelOptSchema schema,
RelDataType rowType,
Table table,
Path path) |
boolean |
equals(Object obj) |
protected RelOptTable |
extend(Table extendedTable)
Implementation-specific code to instantiate a new
RelOptTable
based on a Table that has been extended. |
SqlAccessType |
getAllowedAccess()
Returns the access type of the table
|
private static com.google.common.base.Function<Class,Expression> |
getClassExpressionFunction(CalciteSchema.TableEntry tableEntry,
Table table) |
private static com.google.common.base.Function<Class,Expression> |
getClassExpressionFunction(SchemaPlus schema,
String tableName,
Table table) |
List<RelCollation> |
getCollationList()
Returns a description of the physical ordering (or orderings) of the rows
returned from this table.
|
RelDistribution |
getDistribution()
Returns a description of the physical distribution of the rows
in this table.
|
Expression |
getExpression(Class clazz)
Generates code for this table.
|
SqlMonotonicity |
getMonotonicity(String columnName)
Returns whether a given column is monotonic.
|
List<String> |
getQualifiedName()
Obtains an identifier for this table.
|
List<RelReferentialConstraint> |
getReferentialConstraints()
Returns the referential constraints existing for this table.
|
RelOptSchema |
getRelOptSchema()
Returns the
RelOptSchema this table belongs to. |
double |
getRowCount()
Returns an estimate of the number of rows in the table.
|
RelDataType |
getRowType()
Describes the type of rows returned by this table.
|
int |
hashCode() |
boolean |
isKey(ImmutableBitSet columns)
Returns whether the given columns are a key or a superset of a unique key
of this table.
|
static int |
realOrdinal(RelOptTable table,
int i)
Converts the ordinal of a field into the ordinal of a stored field.
|
static RelDataType |
realRowType(RelOptTable table)
Returns the row type of a table after any
ColumnStrategy.VIRTUAL
columns have been removed. |
boolean |
supportsModality(SqlModality modality) |
RelNode |
toRel(RelOptTable.ToRelContext context)
Converts this table into a
relational expression. |
<T> T |
unwrap(Class<T> clazz)
Finds an instance of an interface implemented by this object,
or returns null if this object does not support that interface.
|
columnHasDefaultValue, extend, getColumnStrategiesprivate final RelOptSchema schema
private final RelDataType rowType
private final Table table
private final com.google.common.base.Function<Class,Expression> expressionFunction
private final com.google.common.collect.ImmutableList<String> names
private final Double rowCount
If not null, overrides the estimate from the actual table.
Useful when a table that contains a materialized query result is being used to replace a query expression that wildly underestimates the row count. Now the materialized table can tell the same lie.
private RelOptTableImpl(RelOptSchema schema, RelDataType rowType, List<String> names, Table table, com.google.common.base.Function<Class,Expression> expressionFunction, Double rowCount)
public static RelOptTableImpl create(RelOptSchema schema, RelDataType rowType, List<String> names, Expression expression)
public static RelOptTableImpl create(RelOptSchema schema, RelDataType rowType, Table table, Path path)
public static RelOptTableImpl create(RelOptSchema schema, RelDataType rowType, CalciteSchema.TableEntry tableEntry, Double rowCount)
public RelOptTableImpl copy(RelDataType newRowType)
private static com.google.common.base.Function<Class,Expression> getClassExpressionFunction(CalciteSchema.TableEntry tableEntry, Table table)
private static com.google.common.base.Function<Class,Expression> getClassExpressionFunction(SchemaPlus schema, String tableName, Table table)
public static RelOptTableImpl create(RelOptSchema schema, RelDataType rowType, Table table, com.google.common.collect.ImmutableList<String> names)
public <T> T unwrap(Class<T> clazz)
Wrapperpublic Expression getExpression(Class clazz)
RelOptTableclazz - The desired collection class; for example Queryable.protected RelOptTable extend(Table extendedTable)
Prepare.AbstractPreparingTableRelOptTable
based on a Table that has been extended.extend in class Prepare.AbstractPreparingTablepublic double getRowCount()
RelOptTablepublic RelOptSchema getRelOptSchema()
RelOptTableRelOptSchema this table belongs to.public RelNode toRel(RelOptTable.ToRelContext context)
RelOptTablerelational expression.
The planner calls this
method to convert a table into an initial relational expression,
generally something abstract, such as a
LogicalTableScan,
then optimizes this expression by
applying rules to transform it
into more efficient access methods for this table.
public List<RelCollation> getCollationList()
RelOptTableRelMetadataQuery.collations(RelNode)public RelDistribution getDistribution()
RelOptTableRelMetadataQuery.distribution(RelNode)public boolean isKey(ImmutableBitSet columns)
RelOptTablecolumns - Ordinals of key columnspublic List<RelReferentialConstraint> getReferentialConstraints()
RelOptTableRelReferentialConstraint nodes.public RelDataType getRowType()
RelOptTablepublic boolean supportsModality(SqlModality modality)
public List<String> getQualifiedName()
RelOptTablepublic SqlMonotonicity getMonotonicity(String columnName)
SqlValidatorTablepublic SqlAccessType getAllowedAccess()
SqlValidatorTablepublic static List<ColumnStrategy> columnStrategies(RelOptTable table)
public static int realOrdinal(RelOptTable table, int i)
public static RelDataType realRowType(RelOptTable table)
ColumnStrategy.VIRTUAL
columns have been removed. This is the type of the records that are
actually stored.Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.