public class JDBCAppendTableSink extends Object implements org.apache.flink.table.sinks.AppendStreamTableSink<Row>, org.apache.flink.table.sinks.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. |
void |
emitDataSet(DataSet<Row> dataSet) |
void |
emitDataStream(DataStream<Row> dataStream) |
String[] |
getFieldNames()
Returns the names of the table fields.
|
TypeInformation<?>[] |
getFieldTypes()
Returns the types of the table fields.
|
TypeInformation<Row> |
getOutputType()
Returns the type expected by this
TableSink . |
public static JDBCAppendTableSinkBuilder builder()
public void emitDataStream(DataStream<Row> dataStream)
public void emitDataSet(DataSet<Row> dataSet)
emitDataSet
in interface org.apache.flink.table.sinks.BatchTableSink<Row>
public TypeInformation<Row> getOutputType()
TableSink
TableSink
.
This type should depend on the types returned by TableSink.getFieldNames()
.
getOutputType
in interface TableSink<Row>
TableSink
.public String[] getFieldNames()
TableSink
getFieldNames
in interface TableSink<Row>
public TypeInformation<?>[] getFieldTypes()
TableSink
getFieldTypes
in interface TableSink<Row>
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.