Interface CatalogView
-
- All Superinterfaces:
CatalogBaseTable
- All Known Implementing Classes:
AbstractCatalogView
,CatalogViewImpl
,QueryOperationCatalogView
,ResolvedCatalogView
@PublicEvolving public interface CatalogView extends CatalogBaseTable
Represents the unresolved metadata of a view in aCatalog
.It contains all characteristics that can be expressed in a SQL
CREATE VIEW
statement. The framework will resolve instances of this interface to aResolvedCatalogView
before usage.A catalog implementer can either use
of(Schema, String, String, String, Map)
for a basic implementation of this interface or create a custom class that allows passing catalog-specific objects (if necessary).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.table.catalog.CatalogBaseTable
CatalogBaseTable.TableKind
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
getExpandedQuery()
Expanded text of the original view definition This is needed because the context such as current DB is lost after the session, in which view is defined, is gone.String
getOriginalQuery()
Original text of the view definition that also preserves the original formatting.default CatalogBaseTable.TableKind
getTableKind()
The kind of table thisCatalogBaseTable
describes.static CatalogView
of(Schema schema, String comment, String originalQuery, String expandedQuery, Map<String,String> options)
Creates a basic implementation of this interface.-
Methods inherited from interface org.apache.flink.table.catalog.CatalogBaseTable
copy, getComment, getDescription, getDetailedDescription, getOptions, getSchema, getUnresolvedSchema
-
-
-
-
Method Detail
-
of
static CatalogView of(Schema schema, @Nullable String comment, String originalQuery, String expandedQuery, Map<String,String> options)
Creates a basic implementation of this interface.The signature is similar to a SQL
CREATE VIEW
statement.- Parameters:
schema
- unresolved schemacomment
- optional commentoriginalQuery
- original text of the view definitionexpandedQuery
- expanded text of the original view definition with materialized identifiersoptions
- options to configure the connector
-
getTableKind
default CatalogBaseTable.TableKind getTableKind()
Description copied from interface:CatalogBaseTable
The kind of table thisCatalogBaseTable
describes.- Specified by:
getTableKind
in interfaceCatalogBaseTable
-
getOriginalQuery
String getOriginalQuery()
Original text of the view definition that also preserves the original formatting.- Returns:
- the original string literal provided by the user.
-
getExpandedQuery
String getExpandedQuery()
Expanded text of the original view definition This is needed because the context such as current DB is lost after the session, in which view is defined, is gone. Expanded query text takes care of this, as an example.For example, for a view that is defined in the context of "default" database with a query
select * from test1
, the expanded query text might becomeselect `test1`.`name`, `test1`.`value` from `default`.`test1`
, where table test1 resides in database "default" and has two columns ("name" and "value").- Returns:
- the view definition in expanded text.
-
-