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 protected
DefaultCatalogMaterializedTable(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 CatalogBaseTable
copy()
Get a deep copy of the CatalogBaseTable instance.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.boolean
equals(Object o)
String
getComment()
Get comment of the table or view.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.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.LogicalRefreshMode
getLogicalRefreshMode()
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.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.Schema
getUnresolvedSchema()
Returns the schema of the table or view.int
hashCode()
boolean
isPartitioned()
Check if the table is partitioned or not.String
toString()
-
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:CatalogBaseTable
Returns 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:
getUnresolvedSchema
in interfaceCatalogBaseTable
- See Also:
ResolvedCatalogTable
,ResolvedCatalogView
-
getComment
public String getComment()
Description copied from interface:CatalogBaseTable
Get comment of the table or view.- Specified by:
getComment
in interfaceCatalogBaseTable
- Returns:
- comment of the table/view.
-
isPartitioned
public boolean isPartitioned()
Description copied from interface:CatalogMaterializedTable
Check if the table is partitioned or not.- Specified by:
isPartitioned
in interfaceCatalogMaterializedTable
- Returns:
- true if the table is partitioned; otherwise, false
-
getPartitionKeys
public List<String> getPartitionKeys()
Description copied from interface:CatalogMaterializedTable
Get the partition keys of the table. This will be an empty set if the table is not partitioned.- Specified by:
getPartitionKeys
in interfaceCatalogMaterializedTable
- Returns:
- partition keys of the table
-
getOptions
public Map<String,String> getOptions()
Description copied from interface:CatalogBaseTable
Returns 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. SeeDynamicTableFactory
for more information. If aCatalogTable
should not be serializable, an implementation can simply throw a runtime exception in this method.- Specified by:
getOptions
in interfaceCatalogBaseTable
-
copy
public CatalogBaseTable copy()
Description copied from interface:CatalogBaseTable
Get a deep copy of the CatalogBaseTable instance.- Specified by:
copy
in interfaceCatalogBaseTable
- Returns:
- a copy of the CatalogBaseTable instance
-
copy
public CatalogMaterializedTable copy(Map<String,String> options)
Description copied from interface:CatalogMaterializedTable
Returns a copy of thisCatalogMaterializedTable
with given table optionsoptions
.- Specified by:
copy
in 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:CatalogMaterializedTable
Returns a copy of thisCatalogDynamicTable
with given refresh info.- Specified by:
copy
in interfaceCatalogMaterializedTable
- Returns:
- a new copy of this table with replaced refresh info
-
getDescription
public Optional<String> getDescription()
Description copied from interface:CatalogBaseTable
Get a brief description of the table or view.- Specified by:
getDescription
in interfaceCatalogBaseTable
- Returns:
- an optional short description of the table/view
-
getDetailedDescription
public Optional<String> getDetailedDescription()
Description copied from interface:CatalogBaseTable
Get a detailed description of the table or view.- Specified by:
getDetailedDescription
in interfaceCatalogBaseTable
- Returns:
- an optional long description of the table/view
-
getSnapshot
public Optional<Long> getSnapshot()
Description copied from interface:CatalogMaterializedTable
Return the snapshot specified for the table. Return Optional.empty() if not specified.- Specified by:
getSnapshot
in interfaceCatalogMaterializedTable
-
getDefinitionQuery
public String getDefinitionQuery()
Description copied from interface:CatalogMaterializedTable
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").- Specified by:
getDefinitionQuery
in interfaceCatalogMaterializedTable
- Returns:
- the materialized table definition in expanded text.
-
getDefinitionFreshness
public IntervalFreshness getDefinitionFreshness()
Description copied from interface:CatalogMaterializedTable
Get the definition freshness of materialized table which is used to determine the physical refresh mode.- Specified by:
getDefinitionFreshness
in interfaceCatalogMaterializedTable
-
getLogicalRefreshMode
public CatalogMaterializedTable.LogicalRefreshMode getLogicalRefreshMode()
Description copied from interface:CatalogMaterializedTable
Get the logical refresh mode of materialized table.- Specified by:
getLogicalRefreshMode
in interfaceCatalogMaterializedTable
-
getRefreshMode
public CatalogMaterializedTable.RefreshMode getRefreshMode()
Description copied from interface:CatalogMaterializedTable
Get the physical refresh mode of materialized table.- Specified by:
getRefreshMode
in interfaceCatalogMaterializedTable
-
getRefreshStatus
public CatalogMaterializedTable.RefreshStatus getRefreshStatus()
Description copied from interface:CatalogMaterializedTable
Get the refresh status of materialized table.- Specified by:
getRefreshStatus
in interfaceCatalogMaterializedTable
-
getRefreshHandlerDescription
public Optional<String> getRefreshHandlerDescription()
Description copied from interface:CatalogMaterializedTable
Return summary description of refresh handler.- Specified by:
getRefreshHandlerDescription
in interfaceCatalogMaterializedTable
-
getSerializedRefreshHandler
@Nullable public byte[] getSerializedRefreshHandler()
Description copied from interface:CatalogMaterializedTable
Return the serialized refresh handler of materialized table. This will not be used for describe table.- Specified by:
getSerializedRefreshHandler
in interfaceCatalogMaterializedTable
-
-