public class JDBCAppendTableSink extends Object implements AppendStreamTableSink<Row>, BatchTableSink<Row>
The mechanisms of Flink guarantees delivering messages at-least-once to this sink (if
checkpointing is enabled). However, one common use case is to run idempotent queries
(e.g., REPLACE
or INSERT OVERWRITE
) to upsert into the database and
achieve exactly-once semantic.
Modifier and Type | Method and Description |
---|---|
static JDBCAppendTableSinkBuilder |
builder() |
TableSink<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<Row> dataStream)
Consumes the DataStream and return the sink transformation
DataStreamSink . |
void |
emitDataSet(DataSet<Row> dataSet)
Emits the DataSet.
|
void |
emitDataStream(DataStream<Row> dataStream)
Emits the DataStream.
|
String[] |
getFieldNames() |
TypeInformation<?>[] |
getFieldTypes() |
TypeInformation<Row> |
getOutputType() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConsumedDataType, getTableSchema
public static JDBCAppendTableSinkBuilder builder()
public DataStreamSink<?> consumeDataStream(DataStream<Row> dataStream)
StreamTableSink
DataStreamSink
.
The returned DataStreamSink
will be used to set resources for the sink operator.consumeDataStream
in interface StreamTableSink<Row>
public void emitDataStream(DataStream<Row> dataStream)
StreamTableSink
emitDataStream
in interface StreamTableSink<Row>
public void emitDataSet(DataSet<Row> dataSet)
BatchTableSink
emitDataSet
in interface BatchTableSink<Row>
public TypeInformation<Row> getOutputType()
getOutputType
in interface TableSink<Row>
public String[] getFieldNames()
getFieldNames
in interface TableSink<Row>
public TypeInformation<?>[] getFieldTypes()
getFieldTypes
in interface TableSink<Row>
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.