public class JdbcUpsertTableSink extends Object implements UpsertStreamTableSink<Row>
UpsertStreamTableSink
for JDBC.Modifier and Type | Class and Description |
---|---|
static class |
JdbcUpsertTableSink.Builder
Builder for a
JdbcUpsertTableSink . |
Modifier and Type | Method and Description |
---|---|
static JdbcUpsertTableSink.Builder |
builder() |
TableSink<Tuple2<Boolean,Row>> |
configure(String[] fieldNames,
TypeInformation<?>[] fieldTypes)
Returns a copy of this
TableSink configured with the field names and types of the
table to emit. |
DataStreamSink<?> |
consumeDataStream(DataStream<Tuple2<Boolean,Row>> dataStream)
Consumes the DataStream and return the sink transformation
DataStreamSink . |
boolean |
equals(Object o) |
String[] |
getFieldNames() |
TypeInformation<?>[] |
getFieldTypes() |
TypeInformation<Tuple2<Boolean,Row>> |
getOutputType() |
TypeInformation<Row> |
getRecordType()
Returns the requested record type.
|
void |
setIsAppendOnly(Boolean isAppendOnly)
Specifies whether the
Table to write is append-only or not. |
void |
setKeyFields(String[] keys)
Configures the unique key fields of the
Table to write. |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConsumedDataType, getTableSchema
public DataStreamSink<?> consumeDataStream(DataStream<Tuple2<Boolean,Row>> dataStream)
StreamTableSink
DataStreamSink
. The
returned DataStreamSink
will be used to set resources for the sink operator.consumeDataStream
in interface StreamTableSink<Tuple2<Boolean,Row>>
public void setKeyFields(String[] keys)
UpsertStreamTableSink
Table
to write. The method is called after
TableSink.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.
setKeyFields
in interface UpsertStreamTableSink<Row>
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.public void setIsAppendOnly(Boolean isAppendOnly)
UpsertStreamTableSink
Table
to write is append-only or not.setIsAppendOnly
in interface UpsertStreamTableSink<Row>
isAppendOnly
- true if the table is append-only, false otherwise.public TypeInformation<Tuple2<Boolean,Row>> getOutputType()
getOutputType
in interface TableSink<Tuple2<Boolean,Row>>
getOutputType
in interface UpsertStreamTableSink<Row>
public TypeInformation<Row> getRecordType()
UpsertStreamTableSink
getRecordType
in interface UpsertStreamTableSink<Row>
public String[] getFieldNames()
getFieldNames
in interface TableSink<Tuple2<Boolean,Row>>
public TypeInformation<?>[] getFieldTypes()
getFieldTypes
in interface TableSink<Tuple2<Boolean,Row>>
public TableSink<Tuple2<Boolean,Row>> configure(String[] fieldNames, TypeInformation<?>[] fieldTypes)
TableSink
TableSink
configured with the field names and types of the
table to emit.public static JdbcUpsertTableSink.Builder builder()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.