All Products
Search
Document Center

DataWorks:GetMetaTablePartition

Last Updated:Sep 18, 2024

Obtains a list of partitions in a metatable.

Operation description

You can call this operation to query only the partitions of a metatable in a MaxCompute or E-MapReduce (EMR) compute engine. If you query partitions of a metatable in an EMR compute engine, only DataLake clusters that use Data Lake Formation (DLF) to manage metadata and Hadoop clusters whose cluster version is earlier than 3.41.0 or 5.7.0 are supported.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
PageNumberintegerNo

The page number.

1
PageSizeintegerNo

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

10
TableGuidstringYes

The unique identifier of the metatable.

odps.engine_name.table_name
ClusterIdstringNo

The ID of the EMR cluster. This parameter is required only if you set the DataSourceType parameter to emr.

You can log on to the EMR console to obtain the ID.

abc
DatabaseNamestringNo

The name of the database. This parameter is required only if you set the DataSourceType parameter to emr.

You can call the ListMetaDB operation to query the name of the metadatabase.

abc
TableNamestringNo

The name of the metatable in the EMR cluster. This parameter is required only if you set the DataSourceType parameter to emr.

You can call the GetMetaDBTableList operation to query the name of the metatable.

abc
DataSourceTypestringNo

The type of the data source. Valid values: odps and emr.

emr
SortCriterionobjectNo

The logic for sorting partitions in the metatable.

SortFieldstringNo

The field that is used to sort partitions in the metatable. Valid values: name and modify_time. By default, partitions in the metatable are sorted based on their creation time.

name
OrderstringNo

The order in which partitions in the metatable are sorted. Valid values: asc and desc. Default value: desc.

desc

Response parameters

ParameterTypeDescriptionExample
object

The data returned.

HttpStatusCodeinteger

The HTTP status code returned.

200
ErrorMessagestring

The error message returned.

The connection does not exist.
RequestIdstring

The request ID.

0bc1ec92159376
Successboolean

Indicates whether the request was successful.

true
ErrorCodestring

The error code returned.

Invalid.Tenant.ConnectionNotExists
Dataobject

The returned result.

PageNumberinteger

The page number.

1
PageSizeinteger

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

10
TotalCountlong

The total number of partitions.

100
DataEntityListarray<object>

The list of partitions.

object
PartitionPathstring

The path of the partition.

abc
DataSizelong

The size of the partition. Unit: bytes.

19
PartitionNamestring

The name of the partition.

pt=20170614
Commentstring

The comment.

test
ModifiedTimelong

The time when the partition was modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

1590032868000
CreateTimelong

The time when the partition was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.

1590032868000
RecordCountlong

The number of entries in the partition.

233
PartitionTypestring

The type of the partition.

abc
PartitionGuidstring

The GUID of the partition.

odps.engine_name.table_name.pt=20170614
PartitionLocationstring

The location of the Hive partition.

abc
TableGuidstring

The unique identifier of the metatable.

odps.engine_name.table_name

Examples

Sample success responses

JSONformat

{
  "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": "test",
        "ModifiedTime": 1590032868000,
        "CreateTime": 1590032868000,
        "RecordCount": 233,
        "PartitionType": "abc",
        "PartitionGuid": "odps.engine_name.table_name.pt=20170614",
        "PartitionLocation": "abc",
        "TableGuid": "odps.engine_name.table_name"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameter.Meta.CommonErrorThe specified parameter is invalid.The request parameter is invalid.
400InvalidParameter.Meta.IllegalThe app guid parameter is invalid.The app guid parameter is invalid.
400InvalidParameter.Meta.IllegalDateThe date format is invalid.The date format is invalid.
400InvalidParameter.Meta.IllegalPageErrorThe parameter for paging is invalid.The parameter for paging is invalid.
400InvalidParameter.Meta.NotExistThe object does not exist.-
400InternalError.Meta.NoCalcEngineAn error occurred while retrieving the compute engine based on the MaxCompute project.Incorrect project entered by user
403Forbidden.Meta.NoTenantThe user is not the owner of any tenants.The user is not the owner of any tenants.
403Forbidden.AccessAccess is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition.No permission, please authorize
429Throttling.ApiThe request for this resource has exceeded your available limit.-
429Throttling.Api.RiskThe request for this resource has exceeded your daily available limit.-
429Throttling.SystemThe DataWorks system is busy. Try again later.-
429Throttling.UserYour request is too frequent. Try again later.-
500InternalError.SystemAn internal system error occurred. Try again later.-
500InternalError.UserId.MissingAn internal system error occurred. Try again later.-
500InternalError.Meta.TenantTimeOutFailed to connect to the interface network.Failed to connect to the interface network.
500InternalError.Meta.UnknownAn unknown error occurred while processing your request.An unknown error occurred while processing your request.

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

Change history

Change timeSummary of changesOperation
2024-02-22The Error code has changedView Change Details
2022-08-11The Error code has changed. The request parameters of the API has changedView Change Details