调用GetPartition获取分区信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String GetPartition

系统规定参数。取值:GetPartition。

DbName String db001

分区所在数据库名称。

TableName String tbl001

分区所在表名。

Values Array of String p001

获取的分区值。

返回数据

名称 类型 示例值 描述
Code String NO_SUCH_OBJECT

如果失败,则返回失败的代码。

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

如果请求失败,则返回失败的详细信息。

PartitionModel Object

分区的详细信息。

CreateTime Long 20180913

分区创建的时间。

DbName String db001

分区所在数据库名称。

Parameters Map

分区属性。

String key001=value001

分区属性。

StorageDescriptorModel Object

分区SD信息。

Cols Array of FieldSchemaModel

分区所在表的列信息。

Comment String this is comment

列注释。

Name String col1

列名称。

Type String string

列类型。

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

表的InputFormat。

Location String oss://data/xxx

表的路径。

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

表的OutputFormat。

Parameters Map

表属性。

String key001=value001

表属性。

SerDeInfoModel Object

表的SerDe信息。

Name String serDeName

SerDe的名称。

Parameters Map

SerDe的属性。

String key001=value001

SerDe的属性。

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

处理serDe的类库。

TableName String tbl001

分区所在的表名。

Values Array of String p001

分区的值。

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

本次请求的RequestId。

Success Boolean false

本次请求是否成功。

示例

请求示例

http(s)://[Endpoint]/?Action=GetPartition
&DbName=db001
&TableName=tbl001
&Values=["p001"]
&公共请求参数

正常返回示例

XML格式

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格式

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"
}

错误码

访问错误中心查看更多错误码。