Adds partitions to the metadata system.

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
Action String Yes AddPartitions

The operation that you want to perform. Set the value to AddPartitions.

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 No

The parameters of the partition.

String No key001=value002

The parameters of the partition.

StorageDescriptor Object Yes

The serializer/deserializer (SerDe) of the partition.

Col Array Yes

The column in the table.

Comment String No this is comment

The comment of the column.

Name String No col1

The name of the column.

Type String No string

The data type of the column.

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

The input format of the table.

Location String No oss://data/xxxx

The Object Storage Service (OSS) directory 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 No

The properties of the SerDe.

String No key001=value002

The properties of the SerDe.

SerDeInfo Object Yes

The SerDe of the table.

Name String No serDeName

The name of the SerDe.

Parameters Map No

The properties of the SerDe.

String No key001=value002

The properties of the SerDe.

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 partition.

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

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<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

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

HTTP status code Error code Error message Description
430 ServerError.Inner An internal error occurred. The error message returned because an internal error has occurred.

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