Interface View

All Superinterfaces:
Auditable
All Known Implementing Classes:
ViewDTO

@Unstable public interface View extends Auditable
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 Details

    • name

      String name()
      Returns the name of the view.
      Returns:
      The view name.
    • comment

      @Nullable default String comment()
      Returns the comment of the view, or null if 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 a null return value.
      Returns:
      The view output columns.
    • representations

      Representation[] representations()
      Returns the representations of the view. A view carries at least one Representation, typically a SQLRepresentation for one or more dialects.
      Returns:
      The view representations.
    • defaultCatalog

      @Nullable default String defaultCatalog()
      Returns the default catalog used to resolve unqualified identifiers referenced by the view definition, or null if not set. The default catalog is shared across all representations.
      Returns:
      The default catalog, or null.
    • defaultSchema

      @Nullable default String defaultSchema()
      Returns the default schema used to resolve unqualified identifiers referenced by the view definition, or null if not set. The default schema is shared across all representations.
      Returns:
      The default schema, or null.
    • sqlFor

      default Optional<SQLRepresentation> sqlFor(String dialect)
      Looks up the SQLRepresentation for the given dialect. Matching is case-insensitive.
      Parameters:
      dialect - The dialect identifier to look up, e.g. "trino".
      Returns:
      An Optional containing the matching SQLRepresentation, or Optional.empty() if no representation for the dialect exists or if the matching representation is not a SQLRepresentation.
    • properties

      default Map<String,String> properties()
      Returns the properties of the view, or an empty map if no properties are set.
      Returns:
      The view properties.