Class SinkRuntimeProviderContext
- java.lang.Object
-
- org.apache.flink.table.runtime.connector.sink.SinkRuntimeProviderContext
-
- All Implemented Interfaces:
DynamicTableSink.Context
@Internal public final class SinkRuntimeProviderContext extends Object implements DynamicTableSink.Context
Implementation ofDynamicTableSink.Context
.
-
-
Constructor Summary
Constructors Constructor Description SinkRuntimeProviderContext(boolean isBounded)
SinkRuntimeProviderContext(boolean isBounded, int[][] targetColumns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DynamicTableSink.DataStructureConverter
createDataStructureConverter(DataType consumedDataType)
Creates a converter for mapping between Flink's internal data structures and objects specified by the givenDataType
that can be passed into a runtime implementation.TypeInformation<?>
createTypeInformation(DataType consumedDataType)
Creates type information describing the internal data structures of the givenDataType
.TypeInformation<?>
createTypeInformation(LogicalType consumedLogicalType)
Creates type information describing the internal data structures of the givenLogicalType
.Optional<int[][]>
getTargetColumns()
Returns anOptional
array of column index paths related to user specified target column list orOptional.empty()
when not specified.boolean
isBounded()
Returns whether a runtime implementation can expect a finite number of rows.
-
-
-
Method Detail
-
isBounded
public boolean isBounded()
Description copied from interface:DynamicTableSink.Context
Returns whether a runtime implementation can expect a finite number of rows.This information might be derived from the session's execution mode and/or kind of query.
- Specified by:
isBounded
in interfaceDynamicTableSink.Context
-
createTypeInformation
public TypeInformation<?> createTypeInformation(DataType consumedDataType)
Description copied from interface:DynamicTableSink.Context
Creates type information describing the internal data structures of the givenDataType
.- Specified by:
createTypeInformation
in interfaceDynamicTableSink.Context
- See Also:
ResolvedSchema.toPhysicalRowDataType()
-
createTypeInformation
public TypeInformation<?> createTypeInformation(LogicalType consumedLogicalType)
Description copied from interface:DynamicTableSink.Context
Creates type information describing the internal data structures of the givenLogicalType
.- Specified by:
createTypeInformation
in interfaceDynamicTableSink.Context
-
createDataStructureConverter
public DynamicTableSink.DataStructureConverter createDataStructureConverter(DataType consumedDataType)
Description copied from interface:DynamicTableSink.Context
Creates a converter for mapping between Flink's internal data structures and objects specified by the givenDataType
that can be passed into a runtime implementation.For example,
RowData
and its fields can be converted into aRow
, or the internal representation for structured types can be converted back into the original (possibly nested) POJO.- Specified by:
createDataStructureConverter
in interfaceDynamicTableSink.Context
- See Also:
LogicalType.supportsOutputConversion(Class)
-
getTargetColumns
public Optional<int[][]> getTargetColumns()
Description copied from interface:DynamicTableSink.Context
Returns anOptional
array of column index paths related to user specified target column list orOptional.empty()
when not specified. The array indices are 0-based and support composite columns within (possibly nested) structures.This information comes from the column list of the DML clause, e.g., for a sink table t1 which schema is:
a STRING, b ROW < b1 INT, b2 STRING>, c BIGINT
- insert: 'insert into t1(a, b.b2) ...', the column list will be 'a, b.b2', and will
return
[[0], [1, 1]]
. The statement 'insert into t1 select ...' without specifying a column list will returnOptional.empty()
. - update: 'update t1 set a=1, b.b1=2 where ...', the column list will be 'a, b.b1',
and will return
[[0], [1, 0]]
.
Note: will always return empty for the delete statement because it has no column list.
- Specified by:
getTargetColumns
in interfaceDynamicTableSink.Context
- insert: 'insert into t1(a, b.b2) ...', the column list will be 'a, b.b2', and will
return
-
-