All Products
Search
Document Center

Data Lake Formation:ListPartitionNames

Last Updated:Apr 01, 2025

You can call this operation to obtain a list of partition names of data tables in a data lake. This method is usually used for multi-level partitioning.

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
dlf:ListPartitionNameslist
*All Resources
*
    none
none

Request syntax

POST /api/metastore/catalogs/databases/tables/partitions/names HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
BodyobjectNo

The HTTP request body.

CatalogIdstringNo

The catalog ID.

1344371
DatabaseNamestringNo

The database name.

database_test
NextPageTokenstringNo

The pagination token. The token is obtained in the returned results. If no pagination token is returned, set this parameter to an empty string.

2cb472ec1bf84f8d92f9c4baa0d21c19aa
PageSizeintegerNo

The number of entries per page. Maximum value: 1000.

10
PartialPartValuesListStringNo

The values of the partition key columns. You can pass in only the values of specific partition key columns to query the names of all lower-level partitions.

TableNamestringNo

The name of the data table.

test_table_20200715162543389

Response parameters

ParameterTypeDescriptionExample
object

The returned result body.

Codestring

The returned message.

OK
Messagestring

The response message.

.
NextPageTokenstring

The paging token.

2cb472ec1bf84f8d92f9c4baa0d21c19aa
PartitionNamesarray

The list of partition names.

PartitionNamestring

The name of the partition.

ds=20201124/hour=10
RequestIdstring

The request ID.

B7F4B621-E41E-4C84-B97F-42B5380A32BB
Successboolean

Indicates whether the request was successful. Valid values: Valid values:

  • true
  • false
true

Code error code description:

  • NoSuchObject: The specified database or table does not exist.
  • InternalError: Other types of errors. For more information, see Message tips.

Examples

Sample success responses

JSONformat

{
  "Code": "OK",
  "Message": ".",
  "NextPageToken": "2cb472ec1bf84f8d92f9c4baa0d21c19aa",
  "PartitionNames": [
    "ds=20201124/hour=10"
  ],
  "RequestId": "B7F4B621-E41E-4C84-B97F-42B5380A32BB",
  "Success": true
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history