Package org.apache.flink.table.catalog
Class ContextResolvedTable
- java.lang.Object
-
- org.apache.flink.table.catalog.ContextResolvedTable
-
@Internal public final class ContextResolvedTable extends Object
This class contains information about a table, itsResolvedSchema
, its options and its relationship with aCatalog
, if any.There can be 3 kinds of
ContextResolvedTable
:- A permanent table: a table which is stored in a
Catalog
and has an associated uniqueObjectIdentifier
. - A temporary table: a table which is stored in the
CatalogManager
, has an associated uniqueObjectIdentifier
and is flagged as temporary. - An anonymous/inline table: a table which is not stored in a catalog and doesn't have an
associated unique
ObjectIdentifier
.
The different handling of temporary and permanent tables is
Catalog
andCatalogManager
instance specific, hence for these two kind of tables, an instance of this object represents the relationship between the specificResolvedCatalogBaseTable
instance and the specificCatalog
/CatalogManager
instances. For example, the sameResolvedCatalogBaseTable
can be temporary for one catalog, but permanent for another one. - A permanent table: a table which is stored in a
-
-
Method Summary
-
-
-
Method Detail
-
permanent
public static ContextResolvedTable permanent(ObjectIdentifier identifier, Catalog catalog, ResolvedCatalogBaseTable<?> resolvedTable)
-
temporary
public static ContextResolvedTable temporary(ObjectIdentifier identifier, ResolvedCatalogBaseTable<?> resolvedTable)
-
anonymous
public static ContextResolvedTable anonymous(ResolvedCatalogBaseTable<?> resolvedTable)
-
anonymous
public static ContextResolvedTable anonymous(String hint, ResolvedCatalogBaseTable<?> resolvedTable)
-
isAnonymous
public boolean isAnonymous()
-
isTemporary
public boolean isTemporary()
- Returns:
- true if the table is temporary. An anonymous table is always temporary.
-
isPermanent
public boolean isPermanent()
-
getIdentifier
public ObjectIdentifier getIdentifier()
-
getCatalog
public Optional<Catalog> getCatalog()
Returns empty ifisPermanent()
is false.
-
getResolvedTable
public <T extends ResolvedCatalogBaseTable<?>> T getResolvedTable()
Returns a fully resolved catalog object.
-
getResolvedSchema
public ResolvedSchema getResolvedSchema()
-
getTable
public <T extends CatalogBaseTable> T getTable()
Returns the original metadata object returned by the catalog.
-
toCatalogTable
public ContextResolvedTable toCatalogTable()
-
copy
public ContextResolvedTable copy(Map<String,String> newOptions)
Copy theContextResolvedTable
, replacing the underlyingCatalogTable
options.
-
copy
public ContextResolvedTable copy(ResolvedSchema newSchema)
Copy theContextResolvedTable
, replacing the underlyingResolvedSchema
.
-
-