...
To avoid secondary generation of DynamicTableSink, we need to construct a StagedSinkModifyOperation that inherits from SinkModifyOperation and then add the DynamicTableSink member variable.
Current non-atomic CTAS implementations
Current Flink supports non-atomic CTAS operations, when it is CreateTableASOperation, we will create the target table first, and then compile and execute the insert operation.
The current program has the following shortcomings:
First: If the insert operation fails, whether it is a compile failure or a job execution failure, flink will not drop the created target table;
Second: Before the job is executed, because the target table already exists, but no data can be read.
Atomic CTAS demo
Then implementation of the atomic CTAS operation requires only two steps :
...