Interface CatalogMaterializedTable
- All Superinterfaces:
CatalogBaseTable
- All Known Implementing Classes:
DefaultCatalogMaterializedTable,ResolvedCatalogMaterializedTable
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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilder for configuring and creating instances ofCatalogMaterializedTable.static enumThe logical refresh mode of materialized table.static enumThe physical refresh mode of materialized table.static enumBackground refresh pipeline status of materialized table.Nested classes/interfaces inherited from interface org.apache.flink.table.catalog.CatalogBaseTable
CatalogBaseTable.TableKind -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of thisCatalogMaterializedTablewith given table optionsoptions.copy(CatalogMaterializedTable.RefreshStatus refreshStatus, String refreshHandlerDescription, byte[] serializedRefreshHandler) Returns a copy of thisCatalogDynamicTablewith given refresh info.Get the definition freshness of materialized table which is used to determine the physical refresh mode.The definition query text of materialized table, text is expanded in contrast to the original SQL.default DurationGet theDurationvalue of materialized table definition freshness, it is converted fromIntervalFreshness.Get the logical refresh mode of materialized table.Get the partition keys of the table.Return summary description of refresh handler.Get the physical refresh mode of materialized table.Get the refresh status of materialized table.byte[]Return the serialized refresh handler of materialized table.Return the snapshot specified for the table.default CatalogBaseTable.TableKindThe kind of table thisCatalogBaseTabledescribes.booleanCheck if the table is partitioned or not.Builder for configuring and creating instances ofCatalogMaterializedTable.Methods inherited from interface org.apache.flink.table.catalog.CatalogBaseTable
copy, getComment, getDescription, getDetailedDescription, getOptions, getSchema, getUnresolvedSchema
-
Method Details
-
newBuilder
Builder for configuring and creating instances ofCatalogMaterializedTable. -
getTableKind
Description copied from interface:CatalogBaseTableThe kind of table thisCatalogBaseTabledescribes.- Specified by:
getTableKindin interfaceCatalogBaseTable
-
isPartitioned
boolean isPartitioned()Check if the table is partitioned or not.- Returns:
- true if the table is partitioned; otherwise, false
-
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 thisCatalogMaterializedTablewith given table optionsoptions.- 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 thisCatalogDynamicTablewith given refresh info.- Returns:
- a new copy of this table with replaced refresh info
-
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 becomeselect `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
Get theDurationvalue of materialized table definition freshness, it is converted fromIntervalFreshness. -
getLogicalRefreshMode
CatalogMaterializedTable.LogicalRefreshMode getLogicalRefreshMode()Get the logical refresh mode of materialized table. -
getRefreshMode
CatalogMaterializedTable.RefreshMode getRefreshMode()Get the physical refresh mode of materialized table. -
getRefreshStatus
CatalogMaterializedTable.RefreshStatus getRefreshStatus()Get the refresh status of materialized table. -
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.
-