Package org.apache.iceberg.flink.sink
Class FlinkSink
java.lang.Object
org.apache.iceberg.flink.sink.FlinkSink
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> FlinkSink.BuilderbuilderFor(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.Builderto export the data from generic input data stream into iceberg table.static FlinkSink.BuilderforRow(org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.types.Row> input, org.apache.flink.table.catalog.ResolvedSchema resolvedSchema) Initialize aFlinkSink.Builderto export the data from input data stream withRows into iceberg table.static FlinkSink.BuilderforRow(org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.types.Row> input, org.apache.flink.table.legacy.api.TableSchema tableSchema) Deprecated.since 1.10.0, will be removed in 2.0.0.static FlinkSink.BuilderforRowData(org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.table.data.RowData> input) Initialize aFlinkSink.Builderto export the data from input data stream withRowDatas 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.Builderto export the data from generic input data stream into iceberg table. We useRowDatainside the sink connector, so users need to provide a mapper function and aTypeInformationto 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 toRowDataoutputType- to define theTypeInformationfor the input data.- Returns:
FlinkSink.Builderto connect the iceberg table.
-
forRow
@Deprecated public static FlinkSink.Builder forRow(org.apache.flink.streaming.api.datastream.DataStream<org.apache.flink.types.Row> input, org.apache.flink.table.legacy.api.TableSchema tableSchema) Deprecated.since 1.10.0, will be removed in 2.0.0. UseforRow(DataStream, ResolvedSchema)instead.Initialize aFlinkSink.Builderto export the data from input data stream withRows into iceberg table. We useRowDatainside the sink connector, so users need to provide aTableSchemafor builder to convert thoseRows to aRowDataDataStream.- Parameters:
input- the source input data stream withRows.tableSchema- defines theTypeInformationfor input data.- Returns:
FlinkSink.Builderto 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.catalog.ResolvedSchema resolvedSchema) Initialize aFlinkSink.Builderto export the data from input data stream withRows into iceberg table. We useRowDatainside the sink connector, so users need to provide aResolvedSchemafor builder to convert thoseRows to aRowDataDataStream.- Parameters:
input- the source input data stream withRows.resolvedSchema- defines theTypeInformationfor input data.- Returns:
FlinkSink.Builderto 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.Builderto export the data from input data stream withRowDatas into iceberg table.- Parameters:
input- the source input data stream withRowDatas.- Returns:
FlinkSink.Builderto connect the iceberg table.
-