Class ResolvedCatalogTable
- java.lang.Object
-
- org.apache.flink.table.catalog.ResolvedCatalogTable
-
- All Implemented Interfaces:
CatalogBaseTable,CatalogTable,ResolvedCatalogBaseTable<CatalogTable>
@PublicEvolving public final class ResolvedCatalogTable extends Object implements ResolvedCatalogBaseTable<CatalogTable>, CatalogTable
A validatedCatalogTablethat is backed by the original metadata coming from theCatalogbut resolved by the framework.Note: Compared to
CatalogTable, instances of this class are serializable for persistence if and only if the originatingCatalogTableimplementsCatalogBaseTable.getOptions(). Catalog implementations are encouraged to usetoProperties(SqlFactory).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.table.catalog.CatalogBaseTable
CatalogBaseTable.TableKind
-
Nested classes/interfaces inherited from interface org.apache.flink.table.catalog.CatalogTable
CatalogTable.Builder
-
-
Constructor Summary
Constructors Constructor Description ResolvedCatalogTable(CatalogTable origin, ResolvedSchema resolvedSchema)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CatalogBaseTablecopy()Get a deep copy of the CatalogBaseTable instance.ResolvedCatalogTablecopy(Map<String,String> options)Returns a copy of thisCatalogTablewith given table optionsoptions.booleanequals(Object o)StringgetComment()Get comment of the table or view.Optional<String>getDescription()Get a brief description of the table or view.Optional<String>getDetailedDescription()Get a detailed description of the table or view.Optional<TableDistribution>getDistribution()Returns the distribution of the table if theDISTRIBUTEDclause is defined.Map<String,String>getOptions()Returns a map of string-based options.CatalogTablegetOrigin()Returns the original, unresolved metadata object from theCatalog.List<String>getPartitionKeys()Get the partition keys of the table.ResolvedSchemagetResolvedSchema()Returns a fully resolved and validatedResolvedSchema.Optional<Long>getSnapshot()Return the snapshot specified for the table.SchemagetUnresolvedSchema()Returns the schema of the table or view.inthashCode()booleanisPartitioned()Check if the table is partitioned or not.Map<String,String>toProperties()Convenience method forCatalogimplementations for serializing instances of this class into a map of string properties.Map<String,String>toProperties(SqlFactory sqlFactory)Convenience method forCatalogimplementations for serializing instances of this class into a map of string properties.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.table.catalog.CatalogTable
getTableKind
-
Methods inherited from interface org.apache.flink.table.catalog.ResolvedCatalogBaseTable
getSchema
-
-
-
-
Constructor Detail
-
ResolvedCatalogTable
public ResolvedCatalogTable(CatalogTable origin, ResolvedSchema resolvedSchema)
-
-
Method Detail
-
getOrigin
public CatalogTable getOrigin()
Description copied from interface:ResolvedCatalogBaseTableReturns the original, unresolved metadata object from theCatalog.This method might be useful if catalog-specific object instances should be directly forwarded from the catalog to a factory.
- Specified by:
getOriginin interfaceResolvedCatalogBaseTable<CatalogTable>
-
getResolvedSchema
public ResolvedSchema getResolvedSchema()
Description copied from interface:ResolvedCatalogBaseTableReturns a fully resolved and validatedResolvedSchema.Connectors can configure themselves by accessing
ResolvedSchema.getPrimaryKey()andResolvedSchema.toPhysicalRowDataType().- Specified by:
getResolvedSchemain interfaceResolvedCatalogBaseTable<CatalogTable>
-
toProperties
public Map<String,String> toProperties()
Convenience method forCatalogimplementations for serializing instances of this class into a map of string properties. Instances are serializable for persistence if and only if the originatingCatalogTableimplementsCatalogBaseTable.getOptions().CatalogTable.fromProperties(Map)provides the reverse operation for deserialization. Note that the serialization and deserialization of catalog tables are not symmetric. The framework will resolve functions and perform other validation tasks. A catalog implementation must not deal with this during a read operation.
-
toProperties
public Map<String,String> toProperties(SqlFactory sqlFactory)
Convenience method forCatalogimplementations for serializing instances of this class into a map of string properties. Instances are serializable for persistence if and only if the originatingCatalogTableimplementsCatalogBaseTable.getOptions().CatalogTable.fromProperties(Map)provides the reverse operation for deserialization. Note that the serialization and deserialization of catalog tables are not symmetric. The framework will resolve functions and perform other validation tasks. A catalog implementation must not deal with this during a read operation.
-
getOptions
public Map<String,String> getOptions()
Description copied from interface:CatalogBaseTableReturns a map of string-based options.In case of
CatalogTable, these options may determine the kind of connector and its configuration for accessing the data in the external system. SeeDynamicTableFactoryfor more information. If aCatalogTableshould not be serializable, an implementation can simply throw a runtime exception in this method.- Specified by:
getOptionsin interfaceCatalogBaseTable
-
getUnresolvedSchema
public Schema getUnresolvedSchema()
Description copied from interface:CatalogBaseTableReturns the schema of the table or view.The schema can reference objects from other catalogs and will be resolved and validated by the framework when accessing the table or view.
- Specified by:
getUnresolvedSchemain interfaceCatalogBaseTable- See Also:
ResolvedCatalogTable,ResolvedCatalogView
-
getComment
public String getComment()
Description copied from interface:CatalogBaseTableGet comment of the table or view.- Specified by:
getCommentin interfaceCatalogBaseTable- Returns:
- comment of the table/view.
-
copy
public CatalogBaseTable copy()
Description copied from interface:CatalogBaseTableGet a deep copy of the CatalogBaseTable instance.- Specified by:
copyin interfaceCatalogBaseTable- Returns:
- a copy of the CatalogBaseTable instance
-
getDescription
public Optional<String> getDescription()
Description copied from interface:CatalogBaseTableGet a brief description of the table or view.- Specified by:
getDescriptionin interfaceCatalogBaseTable- Returns:
- an optional short description of the table/view
-
getDetailedDescription
public Optional<String> getDetailedDescription()
Description copied from interface:CatalogBaseTableGet a detailed description of the table or view.- Specified by:
getDetailedDescriptionin interfaceCatalogBaseTable- Returns:
- an optional long description of the table/view
-
isPartitioned
public boolean isPartitioned()
Description copied from interface:CatalogTableCheck if the table is partitioned or not.- Specified by:
isPartitionedin interfaceCatalogTable- Returns:
- true if the table is partitioned; otherwise, false
-
getPartitionKeys
public List<String> getPartitionKeys()
Description copied from interface:CatalogTableGet the partition keys of the table. This will be an empty set if the table is not partitioned.- Specified by:
getPartitionKeysin interfaceCatalogTable- Returns:
- partition keys of the table
-
getSnapshot
public Optional<Long> getSnapshot()
Description copied from interface:CatalogTableReturn the snapshot specified for the table. Return Optional.empty() if not specified.- Specified by:
getSnapshotin interfaceCatalogTable
-
getDistribution
public Optional<TableDistribution> getDistribution()
Description copied from interface:CatalogTableReturns the distribution of the table if theDISTRIBUTEDclause is defined.- Specified by:
getDistributionin interfaceCatalogTable
-
copy
public ResolvedCatalogTable copy(Map<String,String> options)
Description copied from interface:CatalogTableReturns a copy of thisCatalogTablewith given table optionsoptions.- Specified by:
copyin interfaceCatalogTable- Returns:
- a new copy of this table with replaced table options
-
-