Class FlinkPreparingTableBase
java.lang.Object
org.apache.calcite.prepare.Prepare.AbstractPreparingTable
org.apache.flink.table.planner.plan.schema.FlinkPreparingTableBase
- All Implemented Interfaces:
org.apache.calcite.plan.RelOptTable,org.apache.calcite.prepare.Prepare.PreparingTable,org.apache.calcite.schema.Wrapper,org.apache.calcite.sql.validate.SqlValidatorTable
- Direct Known Subclasses:
CatalogSourceTable,ExpandingPreparingTable
@Internal
public abstract class FlinkPreparingTableBase
extends org.apache.calcite.prepare.Prepare.AbstractPreparingTable
A Flink
Prepare.AbstractPreparingTable implementation for the
purposes of the sql-to-rel conversion and planner.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.plan.RelOptTable
org.apache.calcite.plan.RelOptTable.ToRelContext, org.apache.calcite.plan.RelOptTable.ViewExpander -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFlinkPreparingTableBase(org.apache.calcite.plan.RelOptSchema relOptSchema, org.apache.calcite.rel.type.RelDataType rowType, Iterable<String> names, FlinkStatistic statistic) Creates aPrepare.AbstractPreparingTableinstance. -
Method Summary
Modifier and TypeMethodDescriptionbooleancolumnHasDefaultValue(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.explainSourceAsString(org.apache.flink.table.legacy.sources.TableSource<?> ts) Returns the digest of theTableSourceinstance.protected org.apache.calcite.plan.RelOptTableextend(org.apache.calcite.schema.Table extendedTable) org.apache.calcite.sql.SqlAccessTypeObtains the access type of the table.List<org.apache.calcite.rel.RelCollation>Returns a description of the physical ordering (or orderings) of the rows returned from this table.org.apache.calcite.rel.RelDistributionReturns a description of the physical distribution of the rows in this table.org.apache.calcite.linq4j.tree.ExpressiongetExpression(Class clazz) Generates code for this table, which is not supported now.List<org.apache.calcite.util.ImmutableBitSet>getKeys()org.apache.calcite.sql.validate.SqlMonotonicitygetMonotonicity(String columnName) Obtains whether a given column is monotonic.getNames()Returns the table path in theRelOptSchema.List<org.apache.calcite.rel.RelReferentialConstraint>Returns the referential constraints existing for this table.org.apache.calcite.plan.RelOptSchemadoubleReturns an estimate of the number of rows in the table.org.apache.calcite.rel.type.RelDataTypeReturns the type of rows returned by this table.FlinkStatisticReturns the statistic of this table.booleanisKey(org.apache.calcite.util.ImmutableBitSet columns) Returns whether the given columns are a key or a superset of a unique key of this table.booleanWe recognize all tables in FLink are temporal as they are changeable.booleansupportsModality(org.apache.calcite.sql.validate.SqlModality modality) org.apache.calcite.rel.RelNodetoRel(org.apache.calcite.plan.RelOptTable.ToRelContext context) Returns unique keySets of current table.<C> CMethods inherited from class org.apache.calcite.prepare.Prepare.AbstractPreparingTable
extend, getColumnStrategiesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.calcite.sql.validate.SqlValidatorTable
tableMethods inherited from interface org.apache.calcite.schema.Wrapper
maybeUnwrap, unwrapOrThrow
-
Field Details
-
relOptSchema
@Nullable protected final org.apache.calcite.plan.RelOptSchema relOptSchema -
rowType
protected final org.apache.calcite.rel.type.RelDataType rowType -
names
-
statistic
protected FlinkStatistic statistic
-
-
Constructor Details
-
FlinkPreparingTableBase
public FlinkPreparingTableBase(@Nullable org.apache.calcite.plan.RelOptSchema relOptSchema, org.apache.calcite.rel.type.RelDataType rowType, Iterable<String> names, FlinkStatistic statistic) Creates aPrepare.AbstractPreparingTableinstance.- Parameters:
relOptSchema- The RelOptSchema that this table comes fromrowType- The table row typenames- The table qualified namestatistic- The table statistics
-
-
Method Details
-
getStatistic
public FlinkStatistic getStatistic()Returns the statistic of this table. -
getNames
Returns the table path in theRelOptSchema. Different withgetQualifiedName(), the latter is mainly used for table digest. -
getQualifiedName
-
toRel
public org.apache.calcite.rel.RelNode toRel(org.apache.calcite.plan.RelOptTable.ToRelContext context) -
getMonotonicity
Obtains whether a given column is monotonic.- Parameters:
columnName- Column name- Returns:
- True if the given column is monotonic
-
getAllowedAccess
public org.apache.calcite.sql.SqlAccessType getAllowedAccess()Obtains the access type of the table.- Returns:
- all access types including SELECT/UPDATE/INSERT/DELETE
-
supportsModality
public boolean supportsModality(org.apache.calcite.sql.validate.SqlModality modality) -
isTemporal
public boolean isTemporal()We recognize all tables in FLink are temporal as they are changeable. -
getRowCount
public double getRowCount()Returns an estimate of the number of rows in the table. -
getRowType
public org.apache.calcite.rel.type.RelDataType getRowType()Returns the type of rows returned by this table. -
getRelOptSchema
public org.apache.calcite.plan.RelOptSchema getRelOptSchema() -
getCollationList
Returns a description of the physical ordering (or orderings) of the rows returned from this table.- See Also:
-
RelMetadataQuery.collations(RelNode)
-
getDistribution
public org.apache.calcite.rel.RelDistribution getDistribution()Returns a description of the physical distribution of the rows in this table.- See Also:
-
RelMetadataQuery.distribution(org.apache.calcite.rel.RelNode)
-
isKey
public 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.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.- Parameters:
columns- Ordinals of key columns- Returns:
- If the input columns bits represents a unique column set; false if not (or if no metadata is available)
-
getReferentialConstraints
Returns the referential constraints existing for this table. These constraints are represented over other tables usingRelReferentialConstraintnodes. -
unwrap
-
columnHasDefaultValue
public 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.- Specified by:
columnHasDefaultValuein interfaceorg.apache.calcite.sql.validate.SqlValidatorTable- Overrides:
columnHasDefaultValuein classorg.apache.calcite.prepare.Prepare.AbstractPreparingTable- Parameters:
rowType- Row type of fieldordinal- Index of the given columninitializerContext- Context forInitializerExpressionFactory- Returns:
- true if the column has a default value
-
getExpression
Generates code for this table, which is not supported now.- Parameters:
clazz- The desired collection class, for exampleQueryable
-
extend
protected org.apache.calcite.plan.RelOptTable extend(org.apache.calcite.schema.Table extendedTable) - Specified by:
extendin classorg.apache.calcite.prepare.Prepare.AbstractPreparingTable
-
explainSourceAsString
protected List<String> explainSourceAsString(org.apache.flink.table.legacy.sources.TableSource<?> ts) Returns the digest of theTableSourceinstance. -
getKeys
-
uniqueKeysSet
Returns unique keySets of current table.
-