Package org.apache.gravitino.rel
Interface View
- All Superinterfaces:
Auditable
- All Known Implementing Classes:
ViewDTO
An interface representing a logical view in a
Namespace. A view is a named query whose
definition may be expressed in one or more SQL dialects. A catalog implementation with ViewCatalog should implement this interface.-
Method Summary
Modifier and TypeMethodDescriptionColumn[]columns()Returns the output schema of the view.default Stringcomment()Returns the comment of the view, ornullif no comment is set.default StringReturns the default catalog used to resolve unqualified identifiers referenced by the view definition, ornullif not set.default StringReturns the default schema used to resolve unqualified identifiers referenced by the view definition, ornullif not set.name()Returns the name of the view.Returns the properties of the view, or an empty map if no properties are set.Returns the representations of the view.default Optional<SQLRepresentation>Looks up theSQLRepresentationfor the given dialect.
-
Method Details
-
name
String name()Returns the name of the view.- Returns:
- The view name.
-
comment
Returns the comment of the view, ornullif no comment is set.- Returns:
- The view comment, or
null.
-
columns
Column[] columns()Returns the output schema of the view. Implementations should return an empty array when the output schema is unknown; callers should not rely on anullreturn value.- Returns:
- The view output columns.
-
representations
Representation[] representations()Returns the representations of the view. A view carries at least oneRepresentation, typically aSQLRepresentationfor one or more dialects.- Returns:
- The view representations.
-
defaultCatalog
Returns the default catalog used to resolve unqualified identifiers referenced by the view definition, ornullif not set. The default catalog is shared across allrepresentations.- Returns:
- The default catalog, or
null.
-
defaultSchema
Returns the default schema used to resolve unqualified identifiers referenced by the view definition, ornullif not set. The default schema is shared across allrepresentations.- Returns:
- The default schema, or
null.
-
sqlFor
Looks up theSQLRepresentationfor the given dialect. Matching is case-insensitive.- Parameters:
dialect- The dialect identifier to look up, e.g."trino".- Returns:
- An
Optionalcontaining the matchingSQLRepresentation, orOptional.empty()if no representation for the dialect exists or if the matching representation is not aSQLRepresentation.
-
properties
Returns the properties of the view, or an empty map if no properties are set.- Returns:
- The view properties.
-