Interface SupportsStaging
-
@PublicEvolving public interface SupportsStagingInterface forDynamicTableSinks 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 aStagedTableto tell the Flink how to implement the atomicity semantics.If the user turns on
TableConfigOptions#TABLE_RTAS_CTAS_ATOMICITY_ENABLED, and theDynamicTableSinkimplementsSupportsStaging, the planner will call methodapplyStaging(StagingContext)to get theStagedTablereturned by the sink, then theStagedTablewill be used by Flink to implement a two-phase commit with the actual implementation of theStagedTable.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSupportsStaging.StagingContextThe context is intended to tell DynamicTableSink the type of this operation.static classSupportsStaging.StagingPurposeThe type of operation the staging sink is for.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StagedTableapplyStaging(SupportsStaging.StagingContext context)Provides aSupportsStaging.StagingContextfor the sink modification and return aStagedTable.
-
-
-
Method Detail
-
applyStaging
StagedTable applyStaging(SupportsStaging.StagingContext context)
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.
-
-