Interface SupportsStaging
-
@PublicEvolving public interface SupportsStaging
Interface forDynamicTableSink
s 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 aStagedTable
to tell the Flink how to implement the atomicity semantics.If the user turns on
TableConfigOptions#TABLE_RTAS_CTAS_ATOMICITY_ENABLED
, and theDynamicTableSink
implementsSupportsStaging
, the planner will call methodapplyStaging(StagingContext)
to get theStagedTable
returned by the sink, then theStagedTable
will 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 interface
SupportsStaging.StagingContext
The context is intended to tell DynamicTableSink the type of this operation.static class
SupportsStaging.StagingPurpose
The type of operation the staging sink is for.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StagedTable
applyStaging(SupportsStaging.StagingContext context)
Provides aSupportsStaging.StagingContext
for the sink modification and return aStagedTable
.
-
-
-
Method Detail
-
applyStaging
StagedTable applyStaging(SupportsStaging.StagingContext context)
Provides aSupportsStaging.StagingContext
for the sink modification and return aStagedTable
. TheStagedTable
provides 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:
StagedTable
that will be leveraged by Flink framework to provide atomicity semantics.
-
-