Interface UpsertStreamTableSink<T>
-
- Type Parameters:
T
- Type of records that thisTableSink
expects and supports.
- All Superinterfaces:
StreamTableSink<org.apache.flink.api.java.tuple.Tuple2<Boolean,T>>
,org.apache.flink.table.legacy.sinks.TableSink<org.apache.flink.api.java.tuple.Tuple2<Boolean,T>>
@Deprecated @Internal public interface UpsertStreamTableSink<T> extends StreamTableSink<org.apache.flink.api.java.tuple.Tuple2<Boolean,T>>
Deprecated.This interface has been replaced byDynamicTableSink
. The new interface consumes internal data structures. See FLIP-95 for more information.Defines an externalTableSink
to emit a streamingTable
with insert, update, and delete changes. TheTable
must be have unique key fields (atomic or composite) or be append-only.If the
Table
does not have a unique key and is not append-only, aTableException
will be thrown.The unique key of the table is configured by the
setKeyFields(String[])
method.The
Table
will be converted into a stream of upsert and delete messages which are encoded asTuple2
. The first field is aBoolean
flag to indicate the message type. The second field holds the record of the requested typeUpsertStreamTableSink
.A message with true
Boolean
field is an upsert message for the configured key.A message with false flag is a delete message for the configured key.
If the table is append-only, all messages will have a true flag and must be interpreted as insertions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.api.java.tuple.Tuple2<Boolean,T>>
getOutputType()
Deprecated.org.apache.flink.api.common.typeinfo.TypeInformation<T>
getRecordType()
Deprecated.Returns the requested record type.void
setIsAppendOnly(Boolean isAppendOnly)
Deprecated.Specifies whether theTable
to write is append-only or not.void
setKeyFields(String[] keys)
Deprecated.Configures the unique key fields of theTable
to write.-
Methods inherited from interface org.apache.flink.legacy.table.sinks.StreamTableSink
consumeDataStream
-
-
-
-
Method Detail
-
setKeyFields
void setKeyFields(String[] keys)
Deprecated.Configures the unique key fields of theTable
to write. The method is called afterTableSink.configure(String[], TypeInformation[])
.The keys array might be empty, if the table consists of a single (updated) record. If the table does not have a key and is append-only, the keys attribute is null.
- Parameters:
keys
- the field names of the table's keys, an empty array if the table has a single row, and null if the table is append-only and has no key.
-
setIsAppendOnly
void setIsAppendOnly(Boolean isAppendOnly)
Deprecated.Specifies whether theTable
to write is append-only or not.- Parameters:
isAppendOnly
- true if the table is append-only, false otherwise.
-
getRecordType
org.apache.flink.api.common.typeinfo.TypeInformation<T> getRecordType()
Deprecated.Returns the requested record type.
-
-