@PublicEvolving public interface DynamicTableSink
Dynamic tables are the core concept of Flink's Table & SQL API for processing both bounded and unbounded data in a unified fashion. By definition, a dynamic table can change over time.
When writing a dynamic table, the content can always be considered as a changelog (finite or
infinite) for which all changes are written out continuously until the changelog is exhausted.
ChangelogMode indicates the set of changes that the sink accepts during
For regular batch scenarios, the sink can solely accept insert-only rows and write out bounded streams.
For regular streaming scenarios, the sink can solely accept insert-only rows and can write out unbounded streams.
For change data capture (CDC) scenarios, the sink can write out bounded or unbounded streams
with insert, update, and delete rows. See also
DynamicTableSink can be seen as factories that eventually produce
concrete runtime implementation for writing the actual data.
Depending on the optionally declared abilities, the planner might apply changes to an instance and thus mutate the produced runtime implementation.
DynamicTableSink can implement the following abilities:
In the last step, the planner will call
getSinkRuntimeProvider(Context) for obtaining
a provider of runtime implementation.
|Modifier and Type||Interface and Description|
Context for creating runtime implementation via a
Converter for mapping between Flink's internal data structures and objects specified by the given
Provides actual runtime implementation for writing the data.
|Modifier and Type||Method and Description|
Returns a string that summarizes this sink for printing to a console or log.
Creates a copy of this instance during planning.
Returns the set of changes that the sink accepts during runtime.
Returns a provider of runtime implementation for writing the data.
ChangelogMode getChangelogMode(ChangelogMode requestedMode)
The planner can make suggestions but the sink has the final decision what it requires. If
the planner does not support this mode, it will throw an error. For example, the sink can
return that it only supports
requestedMode- expected set of changes by the current plan
DynamicTableSink.SinkRuntimeProvider getSinkRuntimeProvider(DynamicTableSink.Context context)
There might exist different interfaces for runtime implementation which is why
DynamicTableSink.SinkRuntimeProvider serves as the base interface. Concrete
interfaces might be located in other Flink modules.
Independent of the provider interface, the table runtime expects that a sink
implementation accepts internal data structures (see
RowData for more information).
DynamicTableSink.Context offers utilities by the planner for creating runtime
implementation with minimal dependencies to internal data structures.
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.