Package org.apache.iceberg.flink.sink
Class FlinkSink
java.lang.Object
org.apache.iceberg.flink.sink.FlinkSink
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> FlinkSink.Builder
builderFor
(org.apache.flink.streaming.api.datastream.DataStream<T> input, org.apache.flink.api.common.functions.MapFunction<T, org.apache.flink.table.data.RowData> mapper, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> outputType) Initialize aFlinkSink.Builder
to export the data from generic input data stream into iceberg table.static FlinkSink.Builder
forRow
(org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.types.Row> input, org.apache.flink.table.api.TableSchema tableSchema) Initialize aFlinkSink.Builder
to export the data from input data stream withRow
s into iceberg table.static FlinkSink.Builder
forRowData
(org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.table.data.RowData> input) Initialize aFlinkSink.Builder
to export the data from input data stream withRowData
s into iceberg table.
-
Method Details
-
builderFor
public static <T> FlinkSink.Builder builderFor(org.apache.flink.streaming.api.datastream.DataStream<T> input, org.apache.flink.api.common.functions.MapFunction<T, org.apache.flink.table.data.RowData> mapper, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.table.data.RowData> outputType) Initialize aFlinkSink.Builder
to export the data from generic input data stream into iceberg table. We useRowData
inside the sink connector, so users need to provide a mapper function and aTypeInformation
to convert those generic records to a RowData DataStream.- Type Parameters:
T
- the data type of records.- Parameters:
input
- the generic source input data stream.mapper
- function to convert the generic data toRowData
outputType
- to define theTypeInformation
for the input data.- Returns:
FlinkSink.Builder
to connect the iceberg table.
-
forRow
public static FlinkSink.Builder forRow(org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.types.Row> input, org.apache.flink.table.api.TableSchema tableSchema) Initialize aFlinkSink.Builder
to export the data from input data stream withRow
s into iceberg table. We useRowData
inside the sink connector, so users need to provide aTableSchema
for builder to convert thoseRow
s to aRowData
DataStream.- Parameters:
input
- the source input data stream withRow
s.tableSchema
- defines theTypeInformation
for input data.- Returns:
FlinkSink.Builder
to connect the iceberg table.
-
forRowData
public static FlinkSink.Builder forRowData(org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.table.data.RowData> input) Initialize aFlinkSink.Builder
to export the data from input data stream withRowData
s into iceberg table.- Parameters:
input
- the source input data stream withRowData
s.- Returns:
FlinkSink.Builder
to connect the iceberg table.
-