Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create the sink table  in the catalog based on the schema of the query result.
  2. Start the job and write the result to a temporary directory.
  3. If the job executes successfully, then load data into the sink table.
  4. If the job execution fails, then drop the sink table.(This capability requires runtime module support, such as hook, and SQL passes relevant parameters to the runtime module.)

Drop the table if the job fails requires some additional support(both Streaming and Batch):

  • TableSink needs to provide the CleanUp API, developers implement as needed. Do nothing by default. If an exception occurs, can use this API to drop table or delete the temporary directory, etc.

...

otherwise, data is visible in real timeimmediately after writing, which is consistent with the current flink behavior.

Batch mode:

  • FileSystem Sink: Data should be written to the temporary directory first, visible after the final job is successful.
  • Supports transactions or two-phase commit Sink:  Data visible after the final job is successful.
  • Other Sink:  Data is visible immediately after writing.

Public API Changes

Table Environment

...