Versions Compared

Key

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

...

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 true Note: 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

...