Queries information of all partitions in 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
Action String Yes GetPartitions

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

DbName String Yes db001

The name of the database.

TableName String Yes tbl001

The name of the table.

MaxParts Integer No 100

The maximum number of partitions that are returned at a time. Default value: -1. This value indicates that information of all partitions in the table is returned.

Response parameters

Parameter Type Example Description
Code String NO_SUCH_OBJECT

The error code returned.

Message String No such table: db001.tbl001

The error message returned.

Partitions Array of PartitionModel

The partitions returned.

CreateTime Long 20180913

The time when the partition was created.

DbName String db001

The name of the database to which the partition belongs.

Parameters Map

The properties of the partition.

String key001=value001

The properties of the partition.

StorageDescriptorModel Object

The serializer/deserializer (SerDe) of the partition.

Cols Array of FieldSchemaModel

The columns in the table to which the partition belongs.

Comment String this is comment

The comment of the column.

Name String col1

The name of the column.

Type String string

The data type of the column.

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

The input format of the table.

Location String oss://data/xxx

The Object Storage Service (OSS) directory in which the table is stored.

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

The output format of the table.

Parameters Map

The properties of the SerDe.

String key001=value001

The properties of the SerDe.

SerDeInfoModel Object

The SerDe of the table.

Name String serDeName

The name of the SerDe.

Parameters Map

The properties of the SerDe.

String key001=value001

The properties of the SerDe.

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

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

TableName String tbl001

The name of the table to which the partition belongs.

Values Array of String p001

The values of the partition.

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

The ID of the request.

Success Boolean false

Indicates whether the request was successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetPartitions
&DbName=db001
&TableName=tbl001
&MaxParts=100
&<Common request parameters>

Sample success responses

XML format

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

<GetPartitionsResponse>
    <Code>NO_SUCH_OBJECT</Code>
    <Message>No such table: db001.tbl001</Message>
    <Partitions>
        <CreateTime>20180913</CreateTime>
        <DbName>db001</DbName>
        <Parameters>
            <key>key001=value001</key>
        </Parameters>
        <StorageDescriptorModel>
            <Cols>
                <Comment>this is comment</Comment>
                <Name>col1</Name>
                <Type>string</Type>
            </Cols>
            <InputFormat>org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat</InputFormat>
            <Location>oss://data/xxx</Location>
            <OutputFormat>org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat</OutputFormat>
            <Parameters>
                <key>key001=value001</key>
            </Parameters>
            <SerDeInfoModel>
                <Name>serDeName</Name>
                <Parameters>
                    <key>key001=value001</key>
                </Parameters>
                <SerializationLib>org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe</SerializationLib>
            </SerDeInfoModel>
        </StorageDescriptorModel>
        <TableName>tbl001</TableName>
        <Values>p001</Values>
    </Partitions>
    <RequestId>9BEAC206-0795-4DE3-B1FD-964BEF432B23</RequestId>
    <Success>false</Success>
</GetPartitionsResponse>

JSON format

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

{
  "Code" : "NO_SUCH_OBJECT",
  "Message" : "No such table: db001.tbl001",
  "Partitions" : [ {
    "CreateTime" : 20180913,
    "DbName" : "db001",
    "Parameters" : {
      "key" : "key001=value001"
    },
    "StorageDescriptorModel" : {
      "Cols" : [ {
        "Comment" : "this is comment",
        "Name" : "col1",
        "Type" : "string"
      } ],
      "InputFormat" : "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat",
      "Location" : "oss://data/xxx",
      "OutputFormat" : "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat",
      "Parameters" : {
        "key" : "key001=value001"
      },
      "SerDeInfoModel" : {
        "Name" : "serDeName",
        "Parameters" : {
          "key" : "key001=value001"
        },
        "SerializationLib" : "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe"
      }
    },
    "TableName" : "tbl001",
    "Values" : [ "p001" ]
  } ],
  "RequestId" : "9BEAC206-0795-4DE3-B1FD-964BEF432B23",
  "Success" : false
}

Error codes

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