T- Type of records that this
TableSinkexpects and supports.
@PublicEvolving public interface UpsertStreamTableSink<T> extends StreamTableSink<Tuple2<Boolean,T>>
TableSinkto emit a streaming
Tablewith insert, update, and delete changes. The
Tablemust be have unique key fields (atomic or composite) or be append-only.
The unique key of the table is configured by the
Table will be converted into a stream of upsert and delete messages which are
Tuple2. The first field is a
Boolean flag to indicate the message
type. The second field holds the record of the requested type
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.
|Modifier and Type||Method and Description|
Returns the requested record type.
Specifies whether the
Configures the unique key fields of the
void setKeyFields(String keys)
Tableto write. The method is called after
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.
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.
void setIsAppendOnly(Boolean isAppendOnly)
Tableto write is append-only or not.
isAppendOnly- true if the table is append-only, false otherwise.
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.