@Internal public abstract class FlinkPreparingTableBase extends org.apache.calcite.prepare.Prepare.AbstractPreparingTable
Prepare.AbstractPreparingTable
implementation for the
purposes of the sql-to-rel conversion and planner.Modifier and Type | Field and Description |
---|---|
protected List<String> |
names |
protected org.apache.calcite.plan.RelOptSchema |
relOptSchema |
protected org.apache.calcite.rel.type.RelDataType |
rowType |
protected org.apache.flink.table.planner.plan.stats.FlinkStatistic |
statistic |
Constructor and Description |
---|
FlinkPreparingTableBase(org.apache.calcite.plan.RelOptSchema relOptSchema,
org.apache.calcite.rel.type.RelDataType rowType,
Iterable<String> names,
org.apache.flink.table.planner.plan.stats.FlinkStatistic statistic)
Creates a
Prepare.AbstractPreparingTable instance. |
Modifier and Type | Method and Description |
---|---|
boolean |
columnHasDefaultValue(org.apache.calcite.rel.type.RelDataType rowType,
int ordinal,
org.apache.calcite.sql2rel.InitializerContext initializerContext)
Obtains whether the ordinal column has a default value, which is not supported now.
|
protected List<String> |
explainSourceAsString(TableSource<?> ts)
Returns the digest of the
TableSource instance. |
protected org.apache.calcite.plan.RelOptTable |
extend(org.apache.calcite.schema.Table extendedTable) |
org.apache.calcite.sql.SqlAccessType |
getAllowedAccess()
Obtains the access type of the table.
|
List<org.apache.calcite.rel.RelCollation> |
getCollationList()
Returns a description of the physical ordering (or orderings) of the rows returned from this
table.
|
org.apache.calcite.rel.RelDistribution |
getDistribution()
Returns a description of the physical distribution of the rows in this table.
|
org.apache.calcite.linq4j.tree.Expression |
getExpression(Class clazz)
Generates code for this table, which is not supported now.
|
List<org.apache.calcite.util.ImmutableBitSet> |
getKeys() |
org.apache.calcite.sql.validate.SqlMonotonicity |
getMonotonicity(String columnName)
Obtains whether a given column is monotonic.
|
List<String> |
getNames()
Returns the table path in the
RelOptSchema . |
List<String> |
getQualifiedName() |
List<org.apache.calcite.rel.RelReferentialConstraint> |
getReferentialConstraints()
Returns the referential constraints existing for this table.
|
org.apache.calcite.plan.RelOptSchema |
getRelOptSchema() |
double |
getRowCount()
Returns an estimate of the number of rows in the table.
|
org.apache.calcite.rel.type.RelDataType |
getRowType()
Returns the type of rows returned by this table.
|
org.apache.flink.table.planner.plan.stats.FlinkStatistic |
getStatistic()
Returns the statistic of this table.
|
boolean |
isKey(org.apache.calcite.util.ImmutableBitSet columns)
Returns whether the given columns are a key or a superset of a unique key of this table.
|
boolean |
isTemporal()
We recognize all tables in FLink are temporal as they are changeable.
|
boolean |
supportsModality(org.apache.calcite.sql.validate.SqlModality modality) |
org.apache.calcite.rel.RelNode |
toRel(org.apache.calcite.plan.RelOptTable.ToRelContext context) |
Optional<Set<org.apache.calcite.util.ImmutableBitSet>> |
uniqueKeysSet()
Returns unique keySets of current table.
|
<C> C |
unwrap(Class<C> clazz) |
extend, getColumnStrategies
@Nullable protected final org.apache.calcite.plan.RelOptSchema relOptSchema
protected final org.apache.calcite.rel.type.RelDataType rowType
protected org.apache.flink.table.planner.plan.stats.FlinkStatistic statistic
public FlinkPreparingTableBase(@Nullable org.apache.calcite.plan.RelOptSchema relOptSchema, org.apache.calcite.rel.type.RelDataType rowType, Iterable<String> names, org.apache.flink.table.planner.plan.stats.FlinkStatistic statistic)
Prepare.AbstractPreparingTable
instance.relOptSchema
- The RelOptSchema that this table comes fromrowType
- The table row typenames
- The table qualified namestatistic
- The table statisticspublic org.apache.flink.table.planner.plan.stats.FlinkStatistic getStatistic()
public List<String> getNames()
RelOptSchema
. Different with getQualifiedName()
, the latter is mainly used for table digest.public org.apache.calcite.rel.RelNode toRel(org.apache.calcite.plan.RelOptTable.ToRelContext context)
public org.apache.calcite.sql.validate.SqlMonotonicity getMonotonicity(String columnName)
columnName
- Column namepublic org.apache.calcite.sql.SqlAccessType getAllowedAccess()
public boolean supportsModality(org.apache.calcite.sql.validate.SqlModality modality)
public boolean isTemporal()
public double getRowCount()
public org.apache.calcite.rel.type.RelDataType getRowType()
public org.apache.calcite.plan.RelOptSchema getRelOptSchema()
public List<org.apache.calcite.rel.RelCollation> getCollationList()
RelMetadataQuery.collations(RelNode)
public org.apache.calcite.rel.RelDistribution getDistribution()
RelMetadataQuery.distribution(org.apache.calcite.rel.RelNode)
public boolean isKey(org.apache.calcite.util.ImmutableBitSet columns)
Note: Return true means TRUE. However return false means FALSE or NOT KNOWN. It's better
to use RelMetadataQuery.areRowsUnique(org.apache.calcite.rel.RelNode, boolean)
to distinguish
FALSE with NOT KNOWN.
columns
- Ordinals of key columnspublic List<org.apache.calcite.rel.RelReferentialConstraint> getReferentialConstraints()
RelReferentialConstraint
nodes.public <C> C unwrap(Class<C> clazz)
public boolean columnHasDefaultValue(org.apache.calcite.rel.type.RelDataType rowType, int ordinal, org.apache.calcite.sql2rel.InitializerContext initializerContext)
columnHasDefaultValue
in interface org.apache.calcite.sql.validate.SqlValidatorTable
columnHasDefaultValue
in class org.apache.calcite.prepare.Prepare.AbstractPreparingTable
rowType
- Row type of fieldordinal
- Index of the given columninitializerContext
- Context for InitializerExpressionFactory
public org.apache.calcite.linq4j.tree.Expression getExpression(Class clazz)
clazz
- The desired collection class, for example Queryable
protected org.apache.calcite.plan.RelOptTable extend(org.apache.calcite.schema.Table extendedTable)
extend
in class org.apache.calcite.prepare.Prepare.AbstractPreparingTable
protected List<String> explainSourceAsString(TableSource<?> ts)
TableSource
instance.public List<org.apache.calcite.util.ImmutableBitSet> getKeys()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.