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
Catalogand has an associated uniqueObjectIdentifier. - A temporary table: a table which is stored in the
CatalogManager, has an associated uniqueObjectIdentifierand 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
CatalogandCatalogManagerinstance specific, hence for these two kind of tables, an instance of this object represents the relationship between the specificResolvedCatalogBaseTableinstance and the specificCatalog/CatalogManagerinstances. For example, the sameResolvedCatalogBaseTablecan be temporary for one catalog, but permanent for another one. - A permanent table: a table which is stored in a
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ContextResolvedTableanonymous(String hint, org.apache.flink.table.catalog.ResolvedCatalogBaseTable<?> resolvedTable)static ContextResolvedTableanonymous(org.apache.flink.table.catalog.ResolvedCatalogBaseTable<?> resolvedTable)ContextResolvedTablecopy(Map<String,String> newOptions)Copy theContextResolvedTable, replacing the underlyingCatalogTableoptions.ContextResolvedTablecopy(org.apache.flink.table.catalog.ResolvedSchema newSchema)Copy theContextResolvedTable, replacing the underlyingResolvedSchema.booleanequals(Object o)Optional<org.apache.flink.table.catalog.Catalog>getCatalog()Returns empty ifisPermanent()is false.org.apache.flink.table.catalog.ObjectIdentifiergetIdentifier()org.apache.flink.table.catalog.ResolvedSchemagetResolvedSchema()<T extends org.apache.flink.table.catalog.ResolvedCatalogBaseTable<?>>
TgetResolvedTable()Returns a fully resolved catalog object.<T extends org.apache.flink.table.catalog.CatalogBaseTable>
TgetTable()Returns the original metadata object returned by the catalog.inthashCode()booleanisAnonymous()booleanisPermanent()booleanisTemporary()static ContextResolvedTablepermanent(org.apache.flink.table.catalog.ObjectIdentifier identifier, org.apache.flink.table.catalog.Catalog catalog, org.apache.flink.table.catalog.ResolvedCatalogBaseTable<?> resolvedTable)static ContextResolvedTabletemporary(org.apache.flink.table.catalog.ObjectIdentifier identifier, org.apache.flink.table.catalog.ResolvedCatalogBaseTable<?> resolvedTable)ContextResolvedTabletoCatalogTable()StringtoString()
-
-
-
Method Detail
-
permanent
public static ContextResolvedTable permanent(org.apache.flink.table.catalog.ObjectIdentifier identifier, org.apache.flink.table.catalog.Catalog catalog, org.apache.flink.table.catalog.ResolvedCatalogBaseTable<?> resolvedTable)
-
temporary
public static ContextResolvedTable temporary(org.apache.flink.table.catalog.ObjectIdentifier identifier, org.apache.flink.table.catalog.ResolvedCatalogBaseTable<?> resolvedTable)
-
anonymous
public static ContextResolvedTable anonymous(org.apache.flink.table.catalog.ResolvedCatalogBaseTable<?> resolvedTable)
-
anonymous
public static ContextResolvedTable anonymous(String hint, org.apache.flink.table.catalog.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 org.apache.flink.table.catalog.ObjectIdentifier getIdentifier()
-
getCatalog
public Optional<org.apache.flink.table.catalog.Catalog> getCatalog()
Returns empty ifisPermanent()is false.
-
getResolvedTable
public <T extends org.apache.flink.table.catalog.ResolvedCatalogBaseTable<?>> T getResolvedTable()
Returns a fully resolved catalog object.
-
getResolvedSchema
public org.apache.flink.table.catalog.ResolvedSchema getResolvedSchema()
-
getTable
public <T extends org.apache.flink.table.catalog.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 underlyingCatalogTableoptions.
-
copy
public ContextResolvedTable copy(org.apache.flink.table.catalog.ResolvedSchema newSchema)
Copy theContextResolvedTable, replacing the underlyingResolvedSchema.
-
-