Renaming a Partition (Only OBS Tables Supported)

Function

This statement is used to rename partitions.

Syntax

1
2
3
ALTER TABLE table_name
  PARTITION partition_specs
  RENAME TO PARTITION partition_specs;

Keywords

Parameters

Table 1 Parameters

Parameter

Description

table_name

Table name

partition_specs

Partition fields

Precautions

Example

To modify the name of the city='xxx',dt='2008-08-08' partition in the student table to city='xxx',dt='2009-09-09', run the following statement:

1
2
3
ALTER TABLE student
  PARTITION (city='xxx',dt='2008-08-08')
  RENAME TO PARTITION (city='xxx',dt='2009-09-09');