@PublicEvolving
public interface SupportsStaging
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.
| Modifier and Type | Interface and 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.
|
| Modifier and Type | Method and Description |
|---|---|
StagedTable |
applyStaging(SupportsStaging.StagingContext context)
Provides a
SupportsStaging.StagingContext for the sink modification and return a StagedTable. |
StagedTable applyStaging(SupportsStaging.StagingContext context)
SupportsStaging.StagingContext for the sink modification and return a StagedTable.
The StagedTable 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.
context - The context for the sink modificationStagedTable that will be leveraged by Flink framework to provide atomicity
semantics.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.