Updated on 2024-10-09 GMT+08:00

DELETE SEGMENT by ID

Function

This command is used to delete a segment based on the segment ID.

Syntax

DELETE FROM TABLE db_name.table_name WHERE SEGMENT.ID IN (segment_id1,segment_id2);

Parameters Description

Table 1 DELETE LOAD parameters

Parameter

Description

segment_id

ID of the segment to be deleted.

db_name

Database name. If this parameter is not specified, the current database is used.

table_name

Name of a table in the specified database.

Precautions

Segments cannot be deleted from stream tables.

Example

DELETE FROM TABLE CarbonDatabase.CarbonTable WHERE SEGMENT.ID IN (0);

DELETE FROM TABLE CarbonDatabase.CarbonTable WHERE SEGMENT.ID IN (0,5,8);

Response

Success or failure will be recorded in CarbonData logs.