CLEAN FILES
Function
After the DELETE SEGMENT command is executed, the deleted segments are marked as the delete state. After the segments are merged, the status of the original segments changes to compacted. The data files of these segments are not physically deleted. If you want to forcibly delete these files, run the CLEAN FILES command.
However, running this command may result in a query command execution failure.
Syntax
CLEAN FILES FOR TABLE [db_name.]table_name ;
Parameter Description
Parameter |
Description |
---|---|
db_name |
Database name. It consists of letters, digits, and underscores (_). |
table_name |
Name of the database table. It consists of letters, digits, and underscores (_). |
Precautions
None
Examples
Add Carbon configuration parameters.
carbon.clean.file.force.allowed = true
create table carbon01(a int,b string,c string) stored as carbondata;
insert into table carbon01 select 1,'a','aa';
insert into table carbon01 select 2,'b','bb';
delete from table carbon01 where segment.id in (0);
show segments for table carbon01;
CLEAN FILES FOR TABLE carbon01 options('force'='true');
show segments for table carbon01;
In this example, all the segments marked as deleted and compacted are physically deleted.
System Response
Success or failure will be recorded in the driver logs.
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