TRUNCATE TABLES
TRUNCATE TABLE [db.]tbl[ PARTITION(p1, p2, …)];
- The statement empties the data, but retains the table or partition.
- Unlike DELETE, this statement can only empty the specified tables or partitions as a whole, without adding filtering conditions.
- The data deleted by this operation is not recoverable.
- When using this command, the table state should be NORMAL, i.e. SCHEMA CHANGE operations are not allowed.
TRUNCATE TABLE example_db.tbl;
- P1 and P2 partitions of clearing TABLE tbl
TRUNCATE,TABLE