Versions Compared

Key

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

Status

Current state: Under DiscussionAccepted

Discussion thread: https://lists.apache.org/thread/m4r3wrd7p96wdst3nz3ncqzog6kf51cf
JIRA:

 here (<- link to Vote thread: https://issueslists.apache.org/thread/jira/browse/FLINK-XXXX)fosvz0zcyfn6bp6vz2oxl45vq9qhkn2v

JIRA:

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyFLINK-31874

Released: <Flink Version>1.18.0

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

...

Public interfaces Changes

We propose add a inerface for TRUNCATE TABLE statment. The connectors can implement this interface to custom their logic for truncating table.

Code Block
languagejava
/**
 * Enables to delete all existing data in a {@link DynamicTableSink} table using {@code TRUNCATE
 * TABLE} statement.
 *
 * <p>For {@code TRUNCATE TABLE} statement, if the corresponding {@link DynamicTableSink} have
 * implemented this interface, then the method {@link #truncateTable()} will be invoked in execution
 * phase. Otherwise, Flink will throw an exception directly.
 */
@PublicEvolving
public interface SupportsTruncate {

    /**
     * Execute truncating table.
     *
     * @return trueNote: please remember to throw exception if truncate the table successfully otherwise falsethe truncation hasn't been executed successfully,
     * otherwise it'll be still considered to haven been executed successfully by Flink.
     */
    booleanvoid executeTruncation();
}


Proposed Changes

...