Package org.apache.flink.table.catalog
Class ConnectorCatalogTable<T1,T2>
- java.lang.Object
-
- org.apache.flink.table.catalog.AbstractCatalogTable
-
- org.apache.flink.table.catalog.ConnectorCatalogTable<T1,T2>
-
- Type Parameters:
T1
- type of the produced elements by theTableSource
T2
- type of the expected elements by theTableSink
- All Implemented Interfaces:
CatalogBaseTable
,CatalogTable
@Internal public class ConnectorCatalogTable<T1,T2> extends AbstractCatalogTable
ACatalogTable
that wraps aTableSource
and/orTableSink
. This allows registering those in aCatalog
. It can not be persisted as the source and/or sink might be inline implementations and not be representable in a property based form.
-
-
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.CatalogTable
CatalogTable.Builder
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConnectorCatalogTable(TableSource<T1> tableSource, TableSink<T2> tableSink, TableSchema tableSchema, boolean isBatch)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T1> TableSchema
calculateSourceSchema(TableSource<T1> source, boolean isBatch)
CatalogBaseTable
copy()
Get a deep copy of the CatalogBaseTable instance.CatalogTable
copy(Map<String,String> options)
Returns a copy of thisCatalogTable
with given table optionsoptions
.Optional<String>
getDescription()
Get a brief description of the table or view.Optional<String>
getDetailedDescription()
Get a detailed description of the table or view.Optional<TableSink<T2>>
getTableSink()
Optional<TableSource<T1>>
getTableSource()
boolean
isBatch()
static <T2> ConnectorCatalogTable<?,T2>
sink(TableSink<T2> sink, boolean isBatch)
static <T1> ConnectorCatalogTable<T1,?>
source(TableSource<T1> source, boolean isBatch)
static <T1,T2>
ConnectorCatalogTable<T1,T2>sourceAndSink(TableSource<T1> source, TableSink<T2> sink, boolean isBatch)
Map<String,String>
toProperties()
Serializes this instance into a map of string-based properties.-
Methods inherited from class org.apache.flink.table.catalog.AbstractCatalogTable
getComment, getOptions, getPartitionKeys, getSchema, isPartitioned
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.table.catalog.CatalogBaseTable
getUnresolvedSchema
-
Methods inherited from interface org.apache.flink.table.catalog.CatalogTable
getDistribution, getSnapshot, getTableKind
-
-
-
-
Constructor Detail
-
ConnectorCatalogTable
@VisibleForTesting protected ConnectorCatalogTable(TableSource<T1> tableSource, TableSink<T2> tableSink, TableSchema tableSchema, boolean isBatch)
-
-
Method Detail
-
source
public static <T1> ConnectorCatalogTable<T1,?> source(TableSource<T1> source, boolean isBatch)
-
sink
public static <T2> ConnectorCatalogTable<?,T2> sink(TableSink<T2> sink, boolean isBatch)
-
sourceAndSink
public static <T1,T2> ConnectorCatalogTable<T1,T2> sourceAndSink(TableSource<T1> source, TableSink<T2> sink, boolean isBatch)
-
getTableSource
public Optional<TableSource<T1>> getTableSource()
-
isBatch
public boolean isBatch()
-
toProperties
public Map<String,String> toProperties()
Description copied from interface:CatalogTable
Serializes this instance into a map of string-based properties.Compared to the pure table options in
CatalogBaseTable.getOptions()
, the map includes schema, partitioning, and other characteristics in a serialized form.
-
copy
public CatalogTable copy(Map<String,String> options)
Description copied from interface:CatalogTable
Returns a copy of thisCatalogTable
with given table optionsoptions
.- Returns:
- a new copy of this table with replaced table options
-
copy
public CatalogBaseTable copy()
Description copied from interface:CatalogBaseTable
Get a deep copy of the CatalogBaseTable instance.- Returns:
- a copy of the CatalogBaseTable instance
-
getDescription
public Optional<String> getDescription()
Description copied from interface:CatalogBaseTable
Get a brief description of the table or view.- 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.- Returns:
- an optional long description of the table/view
-
calculateSourceSchema
public static <T1> TableSchema calculateSourceSchema(TableSource<T1> source, boolean isBatch)
-
-