Adds partitions to a table.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Partition Array Yes

This parameter applies only to the virtual network operator (VNO) site.

DbName String Yes db001

The name of the database.

Parameters Map Yes

The parameters of the partitions.

String Yes key001=value002

The values of partition parameters.

StorageDescriptor Object Yes

The information of the storage space of the partition.

Col Array Yes

The columns in the table.

Comment String Yes this is comment

The remarks on the columns.

Name String Yes col1

The name of the column.

Type String Yes string

The type of the column.

InputFormat String Yes org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat

The input format of the table.

Location String Yes oss://data/xxxx

The URL of the Object Storage Service (OSS) bucket in which the table is stored.

OutputFormat String Yes org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat

The output format of the table.

Parameters Map Yes

The attributes of the storage space of the partitions.

String Yes key001=value002

The values of the attributes of the storage space of the partitions.

SerDeInfo Object Yes

The information of the serializer/deserializer (SerDe).

Name String Yes serDeName

The name of the SerDe.

Parameters Map Yes

The attributes of the SerDe.

String Yes key001=value002

The values of SerDe attributes.

SerializationLib String Yes org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe

The class library used by the SerDe to perform the serialization and deserialization.

TableName String Yes tbl001

The name of the table.

Values Array of String Yes p001

The values of the partitions.

Response parameters

Parameter Type Example Description
Code String INVALID_OPERATION

The error code returned.

Data Long 2

The number of partitions that are added.

Message String Too many partitions, exceed max partition number

The error message returned.

RequestId String 9BEAC206-0795-4DE3-B1FD-964BEF432B23

The ID of the request.

Success Boolean true

Indicates whether the partitions are added.

Examples

Sample requests

http(s)://[Endpoint]/?Partition=[{"PARAM_KEY":{"TableName":"tbl001","Parameters":{"key":"key001=value002"},"StorageDescriptor":{"Col":[{"PARAM_KEY":{"Comment":"this is comment","Type":"string","Name":"col1"}}],"Parameters":{"key":"key001=value002"},"InputFormat":"org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat","SerDeInfo":{"SerializationLib":"org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe","Parameters":{"key":"key001=value002"},"Name":"serDeName"},"OutputFormat":"org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat","Location":"oss://data/xxxx"},"Values":"[ p001 ]","DbName":"db001"}}]
&<Common request parameters>

Sample success responses

XML format

<Message>Too many partitions, exceed max partition number</Message>
<RequestId>9BEAC206-0795-4DE3-B1FD-964BEF432B23</RequestId>
<Data>2</Data>
<Code>INVALID_OPERATION</Code>
<Success>true</Success>

JSON format

{
    "Message": "Too many partitions, exceed max partition number",
    "RequestId": "9BEAC206-0795-4DE3-B1FD-964BEF432B23",
    "Data": "2",
    "Code": "INVALID_OPERATION",
    "Success": "true"
}

Error codes

For a list of error codes, visit the API Error Center.