Updated on 2026-11-06 GMT+08:00

Truncate Data

Function

Truncate data from a managed table or an OBS table.

Syntax

TRUNCATE TABLE tablename [PARTITION (partcol1=val1, partcol2=val2 ...)]; 

Keywords

Table 1 Keywords

Parameter

Description

tablename

The name of the managed table or OBS table on which the TRUNCATE command is to be executed.

partcol1

The name of the partition in the managed table or OBS table to be truncated.

Precautions

Only supports clearing data from managed tables or OBS tables.

Examples

TRUNCATE TABLE test PARTITION (class = 'test');