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 aCatalog
.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 Classes Modifier and Type Interface Description static class
CatalogMaterializedTable.Builder
Builder for configuring and creating instances ofCatalogMaterializedTable
.static class
CatalogMaterializedTable.LogicalRefreshMode
The logical refresh mode of materialized table.static class
CatalogMaterializedTable.RefreshMode
The physical refresh mode of materialized table.static class
CatalogMaterializedTable.RefreshStatus
Background refresh pipeline status of materialized table.-
Nested classes/interfaces inherited from interface org.apache.flink.table.catalog.CatalogBaseTable
CatalogBaseTable.TableKind
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CatalogMaterializedTable
copy(Map<String,String> options)
Returns a copy of thisCatalogMaterializedTable
with given table optionsoptions
.CatalogMaterializedTable
copy(CatalogMaterializedTable.RefreshStatus refreshStatus, String refreshHandlerDescription, byte[] serializedRefreshHandler)
Returns a copy of thisCatalogDynamicTable
with given refresh info.IntervalFreshness
getDefinitionFreshness()
Get the definition freshness of materialized table which is used to determine the physical refresh mode.String
getDefinitionQuery()
The definition query text of materialized table, text is expanded in contrast to the original SQL.default Duration
getFreshness()
Get theDuration
value of materialized table definition freshness, it is converted fromIntervalFreshness
.CatalogMaterializedTable.LogicalRefreshMode
getLogicalRefreshMode()
Get the logical refresh mode of materialized table.List<String>
getPartitionKeys()
Get the partition keys of the table.Optional<String>
getRefreshHandlerDescription()
Return summary description of refresh handler.CatalogMaterializedTable.RefreshMode
getRefreshMode()
Get the physical refresh mode of materialized table.CatalogMaterializedTable.RefreshStatus
getRefreshStatus()
Get the refresh status of materialized table.byte[]
getSerializedRefreshHandler()
Return the serialized refresh handler of materialized table.Optional<Long>
getSnapshot()
Return the snapshot specified for the table.default CatalogBaseTable.TableKind
getTableKind()
The kind of table thisCatalogBaseTable
describes.boolean
isPartitioned()
Check if the table is partitioned or not.static CatalogMaterializedTable.Builder
newBuilder()
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 Detail
-
newBuilder
@PublicEvolving static CatalogMaterializedTable.Builder newBuilder()
Builder for configuring and creating instances ofCatalogMaterializedTable
.
-
getTableKind
default CatalogBaseTable.TableKind getTableKind()
Description copied from interface:CatalogBaseTable
The kind of table thisCatalogBaseTable
describes.- Specified by:
getTableKind
in interfaceCatalogBaseTable
-
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
CatalogMaterializedTable copy(Map<String,String> options)
Returns a copy of thisCatalogMaterializedTable
with 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 thisCatalogDynamicTable
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 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
default Duration getFreshness()
Get theDuration
value 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
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.
-
-