该接口用于获取表的分区列表。
接口说明
仅支持获取 MaxCompute 和 EMR 两种引擎表的分区列表。 对于 EMR 引擎,仅支持采用数据湖构建(Data Lake Formation)管理元数据的新版本数据湖集群和集群版本小于 3.41.0 或 5.7.0 的 Hadoop 集群。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
dataworks:* |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| PageNumber |
integer |
否 |
请求的数据页数,用于翻页。 |
1 |
| PageSize |
integer |
否 |
每页显示的条数,默认为 10 条,最大 100 条。 |
10 |
| TableGuid |
string |
否 |
表的唯一标识。 |
odps.engine_name.table_name |
| ClusterId |
string |
否 |
EMR 集群的 ID,仅当数据类型为 EMR 时,需要配置该参数。 您可以登录 EMR 的控制台,获取集群 ID。 |
abc |
| DatabaseName |
string |
否 |
数据库的名称。仅当数据类型为 EMR 时,需要配置该参数。 您可以调用 ListMetaDB 接口获取。 |
abc |
| TableName |
string |
否 |
EMR 的表名称。仅当数据类型为 EMR 时,需要配置该参数。 您可以通过调用 GetMetaDBTableList 接口,获取表名称。 |
abc |
| DataSourceType |
string |
否 |
数据类型,支持 ODPS 或者 EMR。 |
emr |
| SortCriterion |
object |
否 |
表分区的排序逻辑。 |
|
| SortField |
string |
否 |
表分区的排序字段。您可通过 name、modify_time 排序。 默认按照表分区的创建时间排序。 |
name |
| Order |
string |
否 |
表分区的排序顺序,支持使用 asc、desc 方式排序。默认使用 desc。 |
desc |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回的数据结构。 |
||
| HttpStatusCode |
integer |
HTTP 状态码。 |
200 |
| ErrorMessage |
string |
错误信息。 |
The connection does not exist. |
| RequestId |
string |
请求 ID。 |
0bc1ec92159376 |
| Success |
boolean |
请求是否成功。 |
true |
| ErrorCode |
string |
错误码。 |
Invalid.Tenant.ConnectionNotExists |
| Data |
object |
业务数据。 |
|
| PageNumber |
integer |
请求的数据页数,用于翻页。 |
1 |
| PageSize |
integer |
每页显示的条数,默认为 10 条,最大 100 条。 |
10 |
| TotalCount |
integer |
分区的总数。 |
100 |
| DataEntityList |
array<object> |
实例列表。 |
|
|
object |
数据的结构。 |
||
| PartitionPath |
string |
分区的目录。 |
abc |
| DataSize |
integer |
分区的大小,单位为 Byte。 |
19 |
| PartitionName |
string |
分区的名称。 |
pt=20170614 |
| Comment |
string |
备注信息。 |
备注 |
| ModifiedTime |
integer |
修改分区的时间,单位为毫秒。 |
1590032868000 |
| CreateTime |
integer |
创建分区的时间,单位为毫秒。 |
1590032868000 |
| RecordCount |
integer |
分区的数据量。 |
233 |
| PartitionType |
string |
分区的类型。 |
abc |
| PartitionGuid |
string |
分区的唯一标识。 |
odps.engine_name.table_name.pt=20170614 |
| PartitionLocation |
string |
Hive 分区的地址。 |
abc |
| TableGuid |
string |
表的唯一标识。 |
odps.engine_name.table_name |
示例
正常返回示例
JSON格式
{
"HttpStatusCode": 200,
"ErrorMessage": "The connection does not exist.",
"RequestId": "0bc1ec92159376",
"Success": true,
"ErrorCode": "Invalid.Tenant.ConnectionNotExists",
"Data": {
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 100,
"DataEntityList": [
{
"PartitionPath": "abc",
"DataSize": 19,
"PartitionName": "pt=20170614",
"Comment": "备注",
"ModifiedTime": 1590032868000,
"CreateTime": 1590032868000,
"RecordCount": 233,
"PartitionType": "abc",
"PartitionGuid": "odps.engine_name.table_name.pt=20170614",
"PartitionLocation": "abc",
"TableGuid": "odps.engine_name.table_name"
}
]
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidParameter.Meta.CommonError | The specified parameter is invalid. | 请求参数错误。 |
| 400 | InvalidParameter.Meta.Illegal | The app guid parameter is invalid. | App参数错误。 |
| 400 | InvalidParameter.Meta.IllegalDate | The date format is invalid. | 日期格式错误。 |
| 400 | InvalidParameter.Meta.IllegalPageError | The parameter for paging is invalid. | 分页信息错误。 |
| 400 | InvalidParameter.Meta.NotExist | The object does not exist. | |
| 400 | InternalError.Meta.NoCalcEngine | An error occurred while retrieving the compute engine based on the MaxCompute project. | 用户输入的 project 不正确 |
| 500 | InternalError.System | An internal system error occurred. Try again later. | |
| 500 | InternalError.UserId.Missing | An internal system error occurred. Try again later. | |
| 500 | InternalError.Meta.TenantTimeOut | Failed to connect to the interface network. | 接口网络不通。 |
| 500 | InternalError.Meta.Unknown | An unknown error occurred while processing your request. | 未知错误。 |
| 403 | Forbidden.Meta.NoTenant | The user is not the owner of any tenants. | 当前的用户不是任何租户的所有者。 |
| 403 | Forbidden.Access | Access is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition. | 没有权限,请授权 |
| 429 | Throttling.Api | The request for this resource has exceeded your available limit. | |
| 429 | Throttling.Api.Risk | The request for this resource has exceeded your daily available limit. | |
| 429 | Throttling.System | The DataWorks system is busy. Try again later. | |
| 429 | Throttling.User | Your request is too frequent. Try again later. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。