@PublicEvolving public interface CatalogView extends CatalogBaseTable
Catalog
.
It contains all characteristics that can be expressed in a SQL CREATE VIEW
statement.
The framework will resolve instances of this interface to a ResolvedCatalogView
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).
CatalogBaseTable.TableKind
Modifier and Type | Method and 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 this
CatalogBaseTable describes. |
static CatalogView |
of(Schema schema,
String comment,
String originalQuery,
String expandedQuery,
Map<String,String> options)
Creates a basic implementation of this interface.
|
copy, getComment, getDescription, getDetailedDescription, getOptions, getSchema, getUnresolvedSchema
static CatalogView of(Schema schema, @Nullable String comment, String originalQuery, String expandedQuery, Map<String,String> options)
The signature is similar to a SQL CREATE VIEW
statement.
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 connectordefault CatalogBaseTable.TableKind getTableKind()
CatalogBaseTable
CatalogBaseTable
describes.getTableKind
in interface CatalogBaseTable
String getOriginalQuery()
String getExpandedQuery()
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 become select
`test1`.`name`, `test1`.`value` from `default`.`test1`
, where table test1 resides in
database "default" and has two columns ("name" and "value").
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.