Queries information of a partition.

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 GetPartition

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

DbName String Yes db001

The name of the database to which the partition belongs.

TableName String Yes tbl001

The name of the table to which the partition belongs.

Values Array of String Yes p001

The values of the partition.

Response parameters

Parameter Type Example Description
Code String NO_SUCH_OBJECT

The error code returned.

Message String No such partition with values: [p001, not_exists] in table: db001.tbl001

The error message returned.

PartitionModel Object

The details about the partition.

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

String key001=value001

The properties of the table.

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=GetPartition
&DbName=db001
&TableName=tbl001
&Values=["p001"]
&<Common request parameters>

Sample success responses

XML format

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

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

JSON format

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

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

Error codes

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