TRUNCATE TABLE
Syntax
TRUNCATE TABLE table_name
Description
This statement is used to remove all rows from a table or partition. When the table property auto.purge is set to the default value false, the deleted data rows will be saved in the file system's recycle bin. However, if auto.purge is set to true, the data rows will be directly deleted.
Remarks
The target table must be a control table, which means table propery external is set to false. Otherwise, an error will be reported during statement execution.
Example
-- Delete a native or control table Create table simple(id int, name string); Insert into simple values(1,'abc'),(2,'def'); select * from simple; id | name ----|------ 1 | abc 2 | def (2 rows) Truncate table simple; select * from simple; id | name ----|------ (0 rows)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot