Altering the Partition Location of a Table (Only OBS Tables Supported)

Function

This statement is used to modify the positions of table partitions.

Syntax

1
2
3
ALTER TABLE table_name
  PARTITION partition_specs
  SET LOCATION obs_path;

Keywords

Parameters

Table 1 Parameters

Parameter

Description

table_name

Table name

partition_specs

Partition fields

obs_path

OBS path

Precautions

Example

To set the OBS path of partition dt='2008-08-08',city='xxx' in table student to obs://bucketName/fileName/student/dt=2008-08-08/city=xxx, run the following statement:

1
2
3
ALTER TABLE student
  PARTITION(dt='2008-08-08',city='xxx')
  SET LOCATION 'obs://bucketName/fileName/student/dt=2008-08-08/city=xxx';