获取数据湖元数据库分区详情列表

调试

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

请求头

该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。

请求语法

POST /api/metastore/catalogs/databases/tables/partitions/list 

请求参数

名称 类型 位置 是否必选 示例值 描述
Object Body

HTTP请求体

CatalogId String Body 1344371

数据库分类命名空间,默认填写主账号Uid

DatabaseName String Body database_test

元数据库名称

NextPageToken String Body 2cb472ec1bf84f8d92f9c4baa0d21c19aa

翻页token,从返回结果返回,无则传空字符串或''

PageSize Integer Body 10

每页大小

PartialPartValues ListString Body

分区值列表,可以只传入部分分区的值,会查询出所有下级分区的分区名

TableName String Body test_table_20200715162543389

元数据表名称

RegionId String Host cn-hangzhou

系统所在的地域ID

返回数据

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

状态码描述

Message String .

提示相关错误信息

NextPageToken String 2cb472ec1bf84f8d92f9c4baa0d21c19aa

翻页token

Partitions Array of Partition

分区详情

RequestId String B7F4B621-E41E-4C84-B97F-42B5380A32BB

请求ID

Success Boolean true

是否成功

Code错误码说明

NoSuchObject:对应的元数据库/表等不存在

InternalError:其他类型错误,请参考Message提示

示例

请求示例

POST /api/metastore/catalogs/databases/tables/partitions/list HTTP/1.1 
{
  "TableName": "test_table_20201225",
  "PageSize": 10,
  "NextPageToken": "''",
  "DatabaseName": "database_test",
  "CatalogId": "1344371",
  "PartialPartValues": [
    "20201124"
  ]
}

正常返回示例

JSON 格式

{
  "Code": "OK",
  "HttpStatusCode": 200,
  "Message": "",
  "NextPageToken": "",
  "Partitions": [
    {
      "CatName": "1344371",
      "CreateTime": 1608814482,
      "DatabaseName": "database_test",
      "LastAccessTime": 0,
      "LastAnalyzedTime": 0,
      "Parameters": {
        "transient_lastDdlTime": "1608814482"
      },
      "PartitionId": "3da6eb47a32e4a72b1fc73c59df7273e",
      "PartitionName": "ds=20201124/hour=10",
      "Privileges": {
        "GroupPrivileges": {},
        "RolePrivileges": {},
        "UserPrivileges": {}
      },
      "Sd": {
        "BucketCols": [],
        "Cols": [
          {
            "Comment": "user_name",
            "Id": "name",
            "Name": "name",
            "Type": "string"
          }
        ],
        "Compressed": false,
        "InputFormat": "input",
        "NumBuckets": 5,
        "OutputFormat": "output",
        "Parameters": {},
        "SerDeInfo": {
          "Parameters": {}
        },
        "SkewedInfo": {
          "SkewedColNames": [],
          "SkewedColValueLocationMaps": {},
          "SkewedColValues": []
        },
        "SortCols": [],
        "StoredAsSubDirectories": false
      },
      "TableId": "f34ff9818d8f4e02a0f965fa940d8e37",
      "TableName": "test_table_20201225",
      "Values": [
        "20201124",
        "10"
      ]
    },
    {
      "CatName": "1344371",
      "CreateTime": 1608814488,
      "DatabaseName": "database_test",
      "LastAccessTime": 0,
      "LastAnalyzedTime": 0,
      "Parameters": {
        "transient_lastDdlTime": "1608814488"
      },
      "PartitionId": "53795bb6fd4a4f7386a371b9118d83c2",
      "PartitionName": "ds=20201124/hour=12",
      "Privileges": {
        "GroupPrivileges": {},
        "RolePrivileges": {},
        "UserPrivileges": {}
      },
      "Sd": {
        "BucketCols": [],
        "Cols": [
          {
            "Comment": "user_name",
            "Id": "name",
            "Name": "name",
            "Type": "string"
          }
        ],
        "Compressed": false,
        "InputFormat": "input",
        "NumBuckets": 5,
        "OutputFormat": "output",
        "Parameters": {},
        "SerDeInfo": {
          "Parameters": {}
        },
        "SkewedInfo": {
          "SkewedColNames": [],
          "SkewedColValueLocationMaps": {},
          "SkewedColValues": []
        },
        "SortCols": [],
        "StoredAsSubDirectories": false
      },
      "TableId": "f34ff9818d8f4e02a0f965fa940d8e37",
      "TableName": "test_table_20201225",
      "Values": [
        "20201124",
        "12"
      ]
    },
    {
      "CatName": "1344371",
      "CreateTime": 1608814492,
      "DatabaseName": "database_test",
      "LastAccessTime": 0,
      "LastAnalyzedTime": 0,
      "Parameters": {
        "transient_lastDdlTime": "1608814492"
      },
      "PartitionId": "da18d24886e84ed083e8ea62f5282499",
      "PartitionName": "ds=20201124/hour=14",
      "Privileges": {
        "GroupPrivileges": {},
        "RolePrivileges": {},
        "UserPrivileges": {}
      },
      "Sd": {
        "BucketCols": [],
        "Cols": [
          {
            "Comment": "user_name",
            "Id": "name",
            "Name": "name",
            "Type": "string"
          }
        ],
        "Compressed": false,
        "InputFormat": "input",
        "NumBuckets": 5,
        "OutputFormat": "output",
        "Parameters": {},
        "SerDeInfo": {
          "Parameters": {}
        },
        "SkewedInfo": {
          "SkewedColNames": [],
          "SkewedColValueLocationMaps": {},
          "SkewedColValues": []
        },
        "SortCols": [],
        "StoredAsSubDirectories": false
      },
      "TableId": "f34ff9818d8f4e02a0f965fa940d8e37",
      "TableName": "test_table_20201225",
      "Values": [
        "20201124",
        "14"
      ]
    }
  ],
  "RequestId": "6C482A82-9411-43B8-8D9A-0B7A10FCCF13",
  "Success": true
}

错误码

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

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