All Products
Search
Document Center

DataWorks:ListPartitions

更新時間:Dec 10, 2025

Queries a list of partitions in a table in Data Map. Only tables of the MaxCompute and E-MapReduce (EMR)-type Hive Metastore Service (HMS) metadata crawlers are supported.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dataworks:ListPartitionslist
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
TableIdstringYes

The ID of the data table.You can refer to the ListTables API response and Concepts related to metadata entities.

maxcompute-column:11075xxxx::test_project:test_schema:test_table
NamestringNo

The partition name.

ds=20250101
SortBystringNo

The sort field. Default value: CreateTime. Valid values:

  • CreateTime: Creation time. Supported only for MaxCompute tables.
  • ModifyTime: Modification time. Supported only for MaxCompute tables.
  • Name: Name. Used for HMS-type tables.
  • RecordCount: Record count. Supported only for MaxCompute tables.
  • DataSize: Storage size. Supported only for MaxCompute tables.
CreateTime
OrderstringNo

The sort order. Default: Asc. Valid values:

  • Asc: Ascending order.
  • Desc: Descending order.
Asc
PageNumberintegerNo

The page number. Default: 1.

1
PageSizeintegerNo

The number of entries per page. Default: 10. Maximum: 100.

10

Response parameters

ParameterTypeDescriptionExample
object

The response.

RequestIdstring

The request ID.

D1E2E5BC-xxxx-xxxx-xxxx-xxxxxx
Successboolean

Indicates whether the request succeeded.

true
PagingInfoobject

Pagination information.

TotalCountlong

The total number of entries.

1
PageNumberinteger

The page number.

1
PageSizeinteger

The number of entries per page.

10
PartitionListarray

The list of table partitions.

PartitionListPartition

The table partition.

Examples

Sample success responses

JSONformat

{
  "RequestId": "D1E2E5BC-xxxx-xxxx-xxxx-xxxxxx",
  "Success": true,
  "PagingInfo": {
    "TotalCount": 1,
    "PageNumber": 1,
    "PageSize": 10,
    "PartitionList": [
      {
        "TableId": "maxcompute-table:accountId::project::table",
        "Name": "ds=20250101",
        "CreateTime": 1700192563000,
        "ModifyTime": 1700192563000,
        "RecordCount": 1000000,
        "DataSize": 4096
      }
    ]
  }
}

Error codes

For a list of error codes, visit the Service error codes.