Interface SupportsStaging
@PublicEvolving
public interface SupportsStaging
Interface for
DynamicTableSinks that support atomic semantic for CTAS(CREATE TABLE AS
SELECT) or RTAS([CREATE OR] REPLACE TABLE AS SELECT) statement using a two-phase commit protocol.
The table sink is responsible for returning a StagedTable to tell the Flink how to
implement the atomicity semantics.
If the user turns on TableConfigOptions#TABLE_RTAS_CTAS_ATOMICITY_ENABLED, and the
DynamicTableSink implements SupportsStaging, the planner will call method applyStaging(StagingContext) to get the StagedTable returned by the sink, then the
StagedTable will be used by Flink to implement a two-phase commit with the actual
implementation of the StagedTable.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe context is intended to tell DynamicTableSink the type of this operation.static enumThe type of operation the staging sink is for. -
Method Summary
Modifier and TypeMethodDescriptionProvides aSupportsStaging.StagingContextfor the sink modification and return aStagedTable.
-
Method Details
-
applyStaging
Provides aSupportsStaging.StagingContextfor the sink modification and return aStagedTable. TheStagedTableprovides transaction abstraction to support atomicity for CTAS/RTAS. Flink will call the relevant API of StagedTable when the Job status switches,Note: This method will be called at the compile stage.
- Parameters:
context- The context for the sink modification- Returns:
StagedTablethat will be leveraged by Flink framework to provide atomicity semantics.
-