Interface CatalogView

    • 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 schema
        comment - optional comment
        originalQuery - original text of the view definition
        expandedQuery - expanded text of the original view definition with materialized identifiers
        options - options to configure the connector
      • 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 become select `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.