Interface CatalogMaterializedTable

All Superinterfaces:
CatalogBaseTable
All Known Implementing Classes:
DefaultCatalogMaterializedTable, ResolvedCatalogMaterializedTable

@PublicEvolving public interface CatalogMaterializedTable extends CatalogBaseTable
Represents the unresolved metadata of a materialized table in a Catalog.

Materialized Table definition: In the context of streaming-batch unified storage, it provides full history data and incremental changelog. By defining the data's production business logic and freshness, data refresh is achieved through continuous or full refresh pipeline, while also possessing the capability for both batch and incremental consumption.

The metadata for CatalogMaterializedTable includes the following four main parts:

  • Schema, comments, options and partition keys.
  • Data freshness, which determines when the data is generated and becomes visible for user.
  • Data production business logic, also known as the definition query.
  • Background refresh pipeline, either through a flink streaming or periodic flink batch job, it is initialized after materialized table is created.
  • Method Details

    • newBuilder

      @PublicEvolving static CatalogMaterializedTable.Builder newBuilder()
      Builder for configuring and creating instances of CatalogMaterializedTable.
    • getTableKind

      default CatalogBaseTable.TableKind getTableKind()
      Description copied from interface: CatalogBaseTable
      The kind of table this CatalogBaseTable describes.
      Specified by:
      getTableKind in interface CatalogBaseTable
    • isPartitioned

      boolean isPartitioned()
      Check if the table is partitioned or not.
      Returns:
      true if the table is partitioned; otherwise, false
    • getPartitionKeys

      List<String> getPartitionKeys()
      Get the partition keys of the table. This will be an empty set if the table is not partitioned.
      Returns:
      partition keys of the table
    • copy

      Returns a copy of this CatalogMaterializedTable with given table options options.
      Returns:
      a new copy of this table with replaced table options
    • copy

      CatalogMaterializedTable copy(CatalogMaterializedTable.RefreshStatus refreshStatus, String refreshHandlerDescription, byte[] serializedRefreshHandler)
      Returns a copy of this CatalogDynamicTable with given refresh info.
      Returns:
      a new copy of this table with replaced refresh info
    • getSnapshot

      Optional<Long> getSnapshot()
      Return the snapshot specified for the table. Return Optional.empty() if not specified.
    • getDefinitionQuery

      String getDefinitionQuery()
      The definition query text of materialized table, text is expanded in contrast to the original SQL. 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 materialized table 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 materialized table definition in expanded text.
    • getDefinitionFreshness

      IntervalFreshness getDefinitionFreshness()
      Get the definition freshness of materialized table which is used to determine the physical refresh mode.
    • getFreshness

      default Duration getFreshness()
      Get the Duration value of materialized table definition freshness, it is converted from IntervalFreshness.
    • getLogicalRefreshMode

      Get the logical refresh mode of materialized table.
    • getRefreshMode

      Get the physical refresh mode of materialized table.
    • getRefreshStatus

      Get the refresh status of materialized table.
    • getRefreshHandlerDescription

      Optional<String> getRefreshHandlerDescription()
      Return summary description of refresh handler.
    • getSerializedRefreshHandler

      @Nullable byte[] getSerializedRefreshHandler()
      Return the serialized refresh handler of materialized table. This will not be used for describe table.