Class DefaultCatalogMaterializedTable
- java.lang.Object
-
- org.apache.flink.table.catalog.DefaultCatalogMaterializedTable
-
- All Implemented Interfaces:
CatalogBaseTable,CatalogMaterializedTable
@Internal public class DefaultCatalogMaterializedTable extends Object implements CatalogMaterializedTable
Default implementation of aCatalogMaterializedTable.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.table.catalog.CatalogBaseTable
CatalogBaseTable.TableKind
-
Nested classes/interfaces inherited from interface org.apache.flink.table.catalog.CatalogMaterializedTable
CatalogMaterializedTable.Builder, CatalogMaterializedTable.LogicalRefreshMode, CatalogMaterializedTable.RefreshMode, CatalogMaterializedTable.RefreshStatus
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultCatalogMaterializedTable(Schema schema, String comment, List<String> partitionKeys, Map<String,String> options, Long snapshot, String definitionQuery, IntervalFreshness freshness, CatalogMaterializedTable.LogicalRefreshMode logicalRefreshMode, CatalogMaterializedTable.RefreshMode refreshMode, CatalogMaterializedTable.RefreshStatus refreshStatus, String refreshHandlerDescription, byte[] serializedRefreshHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CatalogBaseTablecopy()Get a deep copy of the CatalogBaseTable instance.CatalogMaterializedTablecopy(Map<String,String> options)Returns a copy of thisCatalogMaterializedTablewith given table optionsoptions.CatalogMaterializedTablecopy(CatalogMaterializedTable.RefreshStatus refreshStatus, String refreshHandlerDescription, byte[] serializedRefreshHandler)Returns a copy of thisCatalogDynamicTablewith given refresh info.booleanequals(Object o)StringgetComment()Get comment of the table or view.IntervalFreshnessgetDefinitionFreshness()Get the definition freshness of materialized table which is used to determine the physical refresh mode.StringgetDefinitionQuery()The definition query text of materialized table, text is expanded in contrast to the original SQL.Optional<String>getDescription()Get a brief description of the table or view.Optional<String>getDetailedDescription()Get a detailed description of the table or view.CatalogMaterializedTable.LogicalRefreshModegetLogicalRefreshMode()Get the logical refresh mode of materialized table.Map<String,String>getOptions()Returns a map of string-based options.List<String>getPartitionKeys()Get the partition keys of the table.Optional<String>getRefreshHandlerDescription()Return summary description of refresh handler.CatalogMaterializedTable.RefreshModegetRefreshMode()Get the physical refresh mode of materialized table.CatalogMaterializedTable.RefreshStatusgetRefreshStatus()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.SchemagetUnresolvedSchema()Returns the schema of the table or view.inthashCode()booleanisPartitioned()Check if the table is partitioned or not.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.table.catalog.CatalogBaseTable
getSchema
-
Methods inherited from interface org.apache.flink.table.catalog.CatalogMaterializedTable
getFreshness, getTableKind
-
-
-
-
Constructor Detail
-
DefaultCatalogMaterializedTable
protected DefaultCatalogMaterializedTable(Schema schema, @Nullable String comment, List<String> partitionKeys, Map<String,String> options, @Nullable Long snapshot, String definitionQuery, IntervalFreshness freshness, CatalogMaterializedTable.LogicalRefreshMode logicalRefreshMode, CatalogMaterializedTable.RefreshMode refreshMode, CatalogMaterializedTable.RefreshStatus refreshStatus, @Nullable String refreshHandlerDescription, @Nullable byte[] serializedRefreshHandler)
-
-
Method Detail
-
getUnresolvedSchema
public Schema getUnresolvedSchema()
Description copied from interface:CatalogBaseTableReturns the schema of the table or view.The schema can reference objects from other catalogs and will be resolved and validated by the framework when accessing the table or view.
- Specified by:
getUnresolvedSchemain interfaceCatalogBaseTable- See Also:
ResolvedCatalogTable,ResolvedCatalogView
-
getComment
public String getComment()
Description copied from interface:CatalogBaseTableGet comment of the table or view.- Specified by:
getCommentin interfaceCatalogBaseTable- Returns:
- comment of the table/view.
-
isPartitioned
public boolean isPartitioned()
Description copied from interface:CatalogMaterializedTableCheck if the table is partitioned or not.- Specified by:
isPartitionedin interfaceCatalogMaterializedTable- Returns:
- true if the table is partitioned; otherwise, false
-
getPartitionKeys
public List<String> getPartitionKeys()
Description copied from interface:CatalogMaterializedTableGet the partition keys of the table. This will be an empty set if the table is not partitioned.- Specified by:
getPartitionKeysin interfaceCatalogMaterializedTable- Returns:
- partition keys of the table
-
getOptions
public Map<String,String> getOptions()
Description copied from interface:CatalogBaseTableReturns a map of string-based options.In case of
CatalogTable, these options may determine the kind of connector and its configuration for accessing the data in the external system. SeeDynamicTableFactoryfor more information. If aCatalogTableshould not be serializable, an implementation can simply throw a runtime exception in this method.- Specified by:
getOptionsin interfaceCatalogBaseTable
-
copy
public CatalogBaseTable copy()
Description copied from interface:CatalogBaseTableGet a deep copy of the CatalogBaseTable instance.- Specified by:
copyin interfaceCatalogBaseTable- Returns:
- a copy of the CatalogBaseTable instance
-
copy
public CatalogMaterializedTable copy(Map<String,String> options)
Description copied from interface:CatalogMaterializedTableReturns a copy of thisCatalogMaterializedTablewith given table optionsoptions.- Specified by:
copyin interfaceCatalogMaterializedTable- Returns:
- a new copy of this table with replaced table options
-
copy
public CatalogMaterializedTable copy(CatalogMaterializedTable.RefreshStatus refreshStatus, String refreshHandlerDescription, byte[] serializedRefreshHandler)
Description copied from interface:CatalogMaterializedTableReturns a copy of thisCatalogDynamicTablewith given refresh info.- Specified by:
copyin interfaceCatalogMaterializedTable- Returns:
- a new copy of this table with replaced refresh info
-
getDescription
public Optional<String> getDescription()
Description copied from interface:CatalogBaseTableGet a brief description of the table or view.- Specified by:
getDescriptionin interfaceCatalogBaseTable- Returns:
- an optional short description of the table/view
-
getDetailedDescription
public Optional<String> getDetailedDescription()
Description copied from interface:CatalogBaseTableGet a detailed description of the table or view.- Specified by:
getDetailedDescriptionin interfaceCatalogBaseTable- Returns:
- an optional long description of the table/view
-
getSnapshot
public Optional<Long> getSnapshot()
Description copied from interface:CatalogMaterializedTableReturn the snapshot specified for the table. Return Optional.empty() if not specified.- Specified by:
getSnapshotin interfaceCatalogMaterializedTable
-
getDefinitionQuery
public String getDefinitionQuery()
Description copied from interface:CatalogMaterializedTableThe 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").- Specified by:
getDefinitionQueryin interfaceCatalogMaterializedTable- Returns:
- the materialized table definition in expanded text.
-
getDefinitionFreshness
public IntervalFreshness getDefinitionFreshness()
Description copied from interface:CatalogMaterializedTableGet the definition freshness of materialized table which is used to determine the physical refresh mode.- Specified by:
getDefinitionFreshnessin interfaceCatalogMaterializedTable
-
getLogicalRefreshMode
public CatalogMaterializedTable.LogicalRefreshMode getLogicalRefreshMode()
Description copied from interface:CatalogMaterializedTableGet the logical refresh mode of materialized table.- Specified by:
getLogicalRefreshModein interfaceCatalogMaterializedTable
-
getRefreshMode
public CatalogMaterializedTable.RefreshMode getRefreshMode()
Description copied from interface:CatalogMaterializedTableGet the physical refresh mode of materialized table.- Specified by:
getRefreshModein interfaceCatalogMaterializedTable
-
getRefreshStatus
public CatalogMaterializedTable.RefreshStatus getRefreshStatus()
Description copied from interface:CatalogMaterializedTableGet the refresh status of materialized table.- Specified by:
getRefreshStatusin interfaceCatalogMaterializedTable
-
getRefreshHandlerDescription
public Optional<String> getRefreshHandlerDescription()
Description copied from interface:CatalogMaterializedTableReturn summary description of refresh handler.- Specified by:
getRefreshHandlerDescriptionin interfaceCatalogMaterializedTable
-
getSerializedRefreshHandler
@Nullable public byte[] getSerializedRefreshHandler()
Description copied from interface:CatalogMaterializedTableReturn the serialized refresh handler of materialized table. This will not be used for describe table.- Specified by:
getSerializedRefreshHandlerin interfaceCatalogMaterializedTable
-
-