CANCEL-ALTER-TABLE

Name

CANCEL ALTER TABLE

Description

This statement is used to undo an ALTER operation.

  1. Undo the ALTER TABLE COLUMN operation

grammar:

  1. CANCEL ALTER TABLE COLUMN
  2. FROM db_name.table_name
  1. Undo the ALTER TABLE ROLLUP operation

grammar:

  1. CANCEL ALTER TABLE ROLLUP
  2. FROM db_name.table_name
  1. Batch cancel rollup operations based on job id

grammar:

  1. CANCEL ALTER TABLE ROLLUP
  2. FROM db_name.table_name (jobid,...)

Notice:

  • This command is an asynchronous operation. You need to use show alter table rollup to check the task status to confirm whether the execution is successful or not.
  1. Undo the ALTER CLUSTER operation

grammar:

  1. (To be implemented...)

Example

  1. Undo the ALTER COLUMN operation on my_table.

    [CANCEL ALTER TABLE COLUMN]

  1. CANCEL ALTER TABLE COLUMN
  2. FROM example_db.my_table;
  1. Undo the ADD ROLLUP operation under my_table.

    [CANCEL ALTER TABLE ROLLUP]

  1. CANCEL ALTER TABLE ROLLUP
  2. FROM example_db.my_table;
  1. Undo the ADD ROLLUP operation under my_table according to the job id.

    [CANCEL ALTER TABLE ROLLUP]

  1. CANCEL ALTER TABLE ROLLUP
  2. FROM example_db.my_table(12801,12802);

Keywords

  1. CANCEL, ALTER, TABLE, CANCEL ALTER

Best Practice