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 validatedCatalogTable
that is backed by the original metadata coming from theCatalog
but resolved by the framework.Note: Compared to
CatalogTable
, instances of this class are serializable for persistence if and only if the originatingCatalogTable
implementsCatalogBaseTable.getOptions()
. Catalog implementations are encouraged to usetoProperties()
.
-
-
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 CatalogBaseTable
copy()
Get a deep copy of the CatalogBaseTable instance.ResolvedCatalogTable
copy(Map<String,String> options)
Returns a copy of thisCatalogTable
with given table optionsoptions
.boolean
equals(Object o)
String
getComment()
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 theDISTRIBUTED
clause is defined.Map<String,String>
getOptions()
Returns a map of string-based options.CatalogTable
getOrigin()
Returns the original, unresolved metadata object from theCatalog
.List<String>
getPartitionKeys()
Get the partition keys of the table.ResolvedSchema
getResolvedSchema()
Returns a fully resolved and validatedResolvedSchema
.Optional<Long>
getSnapshot()
Return the snapshot specified for the table.Schema
getUnresolvedSchema()
Returns the schema of the table or view.int
hashCode()
boolean
isPartitioned()
Check if the table is partitioned or not.Map<String,String>
toProperties()
Convenience method forCatalog
implementations for serializing instances of this class into a map of string properties.String
toString()
-
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:ResolvedCatalogBaseTable
Returns 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:
getOrigin
in interfaceResolvedCatalogBaseTable<CatalogTable>
-
getResolvedSchema
public ResolvedSchema getResolvedSchema()
Description copied from interface:ResolvedCatalogBaseTable
Returns a fully resolved and validatedResolvedSchema
.Connectors can configure themselves by accessing
ResolvedSchema.getPrimaryKey()
andResolvedSchema.toPhysicalRowDataType()
.- Specified by:
getResolvedSchema
in interfaceResolvedCatalogBaseTable<CatalogTable>
-
toProperties
public Map<String,String> toProperties()
Convenience method forCatalog
implementations for serializing instances of this class into a map of string properties. Instances are serializable for persistence if and only if the originatingCatalogTable
implementsCatalogBaseTable.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.- Specified by:
toProperties
in interfaceCatalogTable
-
getOptions
public Map<String,String> getOptions()
Description copied from interface:CatalogBaseTable
Returns 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. SeeDynamicTableFactory
for more information. If aCatalogTable
should not be serializable, an implementation can simply throw a runtime exception in this method.- Specified by:
getOptions
in interfaceCatalogBaseTable
-
getUnresolvedSchema
public Schema getUnresolvedSchema()
Description copied from interface:CatalogBaseTable
Returns 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:
getUnresolvedSchema
in interfaceCatalogBaseTable
- See Also:
ResolvedCatalogTable
,ResolvedCatalogView
-
getComment
public String getComment()
Description copied from interface:CatalogBaseTable
Get comment of the table or view.- Specified by:
getComment
in interfaceCatalogBaseTable
- Returns:
- comment of the table/view.
-
copy
public CatalogBaseTable copy()
Description copied from interface:CatalogBaseTable
Get a deep copy of the CatalogBaseTable instance.- Specified by:
copy
in interfaceCatalogBaseTable
- Returns:
- a copy of the CatalogBaseTable instance
-
getDescription
public Optional<String> getDescription()
Description copied from interface:CatalogBaseTable
Get a brief description of the table or view.- Specified by:
getDescription
in interfaceCatalogBaseTable
- Returns:
- an optional short description of the table/view
-
getDetailedDescription
public Optional<String> getDetailedDescription()
Description copied from interface:CatalogBaseTable
Get a detailed description of the table or view.- Specified by:
getDetailedDescription
in interfaceCatalogBaseTable
- Returns:
- an optional long description of the table/view
-
isPartitioned
public boolean isPartitioned()
Description copied from interface:CatalogTable
Check if the table is partitioned or not.- Specified by:
isPartitioned
in interfaceCatalogTable
- Returns:
- true if the table is partitioned; otherwise, false
-
getPartitionKeys
public List<String> getPartitionKeys()
Description copied from interface:CatalogTable
Get the partition keys of the table. This will be an empty set if the table is not partitioned.- Specified by:
getPartitionKeys
in interfaceCatalogTable
- Returns:
- partition keys of the table
-
getSnapshot
public Optional<Long> getSnapshot()
Description copied from interface:CatalogTable
Return the snapshot specified for the table. Return Optional.empty() if not specified.- Specified by:
getSnapshot
in interfaceCatalogTable
-
getDistribution
public Optional<TableDistribution> getDistribution()
Description copied from interface:CatalogTable
Returns the distribution of the table if theDISTRIBUTED
clause is defined.- Specified by:
getDistribution
in interfaceCatalogTable
-
copy
public ResolvedCatalogTable copy(Map<String,String> options)
Description copied from interface:CatalogTable
Returns a copy of thisCatalogTable
with given table optionsoptions
.- Specified by:
copy
in interfaceCatalogTable
- Returns:
- a new copy of this table with replaced table options
-
-