GetAutoClusterSuggestion
Queries the current clustering configuration, recommended configuration, and estimated shuffle benefits of a specified table. You can view the corresponding table modification SQL statement when a recommendation is available.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
odps:GetAutoClusterSuggestion |
get |
*Project
|
None | None |
Request syntax
GET /api/v1/projects/{project}/tables/{table}/autoCluster/suggestion HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| project |
string |
Yes |
The name of the MaxCompute project. |
analytics_prod |
| table |
string |
Yes |
The name of the MaxCompute table. |
order_detail |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| date |
string |
No |
The date of the analysis batch in the yyyyMMdd format. If this parameter is not specified, the latest batch of the corresponding dataset is used. |
20251123 |
| schema |
string |
No |
The name of the schema to which the table belongs. |
sales |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
PopResult |
||
| requestId |
string |
The unique identifier of the API request. You can provide this identifier when troubleshooting call issues. |
0be3e0aa16667684362147582e038f |
| httpCode |
integer |
The HTTP status code of the request. |
200 |
| errorCode |
string |
The error code returned when the request fails. |
InvalidArgument |
| errorMsg |
string |
The error message returned when the request fails. |
The specified parameter is invalid. |
| data |
object |
The result of querying automatic clustering recommendations for the table. |
|
| project |
string |
The name of the MaxCompute project. |
analytics_prod |
| schema |
string |
The name of the schema to which the table belongs. |
sales |
| table |
string |
The name of the MaxCompute table. |
order_detail |
| clusterType |
string |
The clustering type. For example, hash indicates hash clustering. |
hash |
| clusterKey |
array |
The list of cluster key column names. |
|
|
string |
The column name of a cluster key. |
customer_id |
|
| sortKey |
array |
The list of sort column names within the cluster. |
|
|
string |
The column name of a sort key. |
customer_id |
|
| bucketNum |
integer |
The number of buckets in the cluster. |
32 |
| partition |
string |
The names of the partition columns of the table. Multiple column names are separated by commas. |
ds,region |
| suggestClusterType |
string |
The recommended clustering type. hash indicates hash clustering. |
hash |
| suggestClusterKey |
array |
The list of recommended cluster key column names. |
|
|
string |
The column name recommended to be used as a cluster key. |
customer_id |
|
| suggestSortKey |
array |
The list of recommended sort column names within the cluster. |
|
|
string |
The column name recommended to be used as a sort key within the cluster. |
customer_id |
|
| suggestBucketNum |
integer |
The recommended number of buckets in the cluster. |
32 |
| savedReadShuffle |
number |
The estimated amount of read shuffle data saved after the recommendation is applied, in GB. |
10.5 |
| increasedWriteShuffle |
number |
The estimated amount of write shuffle data increased after the recommendation is applied, in GB. |
0.75 |
| savedShuffle |
number |
The estimated net amount of shuffle data saved, in GB. This is calculated by subtracting the increased write shuffle data from the saved read shuffle data. |
9.75 |
savedReadCu
deprecated
|
number |
[Deprecated] This field is deprecated and is no longer returned. Do not rely on it. The example is only used to illustrate the data type. |
12.5 |
increasedWriteCu
deprecated
|
number |
[Deprecated] This field is deprecated and is no longer returned. Do not rely on it. The example is only used to illustrate the data type. |
2.5 |
savedCu
deprecated
|
number |
[Deprecated] This field is deprecated and is no longer returned. Do not rely on it. The example is only used to illustrate the data type. |
8.5 |
savedTime
deprecated
|
number |
[Deprecated] This field is deprecated and is no longer returned. Do not rely on it. The example is only used to illustrate the data type. |
15.5 |
benefitJobCount
deprecated
|
integer |
[Deprecated] This field is deprecated and is no longer returned. Do not rely on it. The example is only used to illustrate the data type. |
24 |
| readInstanceList |
array |
The list of read job instance IDs associated with the evaluation of this recommendation. |
|
|
string |
The instance ID of the read job. |
20251123081031234g8x2p2m |
|
| writeInstanceList |
array |
The list of write job instance IDs associated with the evaluation of this recommendation. |
|
|
string |
The instance ID of the write job. |
20251123082031234g8x2p2m |
|
| alterTableSql |
string |
The table modification SQL statement used to apply the recommendation. |
ALTER TABLE order_detail CLUSTERED BY (customer_id) SORTED BY (customer_id) INTO 32 BUCKETS; |
| partitionScanList |
array |
The list of table partitions involved in the recommendation analysis. |
|
|
string |
The identifier of the table partition involved in the analysis. |
ds=20251123 |
|
| applied |
boolean |
Specifies whether the current table configuration is consistent with the recommendation. The clustering type, number of buckets, cluster key, and sort key are compared. |
Examples
Success response
JSON format
{
"requestId": "0be3e0aa16667684362147582e038f",
"httpCode": 200,
"errorCode": "InvalidArgument",
"errorMsg": "The specified parameter is invalid.",
"data": {
"project": "analytics_prod",
"schema": "sales",
"table": "order_detail",
"clusterType": "hash",
"clusterKey": [
"customer_id"
],
"sortKey": [
"customer_id"
],
"bucketNum": 32,
"partition": "ds,region",
"suggestClusterType": "hash",
"suggestClusterKey": [
"customer_id"
],
"suggestSortKey": [
"customer_id"
],
"suggestBucketNum": 32,
"savedReadShuffle": 10.5,
"increasedWriteShuffle": 0.75,
"savedShuffle": 9.75,
"savedReadCu": 12.5,
"increasedWriteCu": 2.5,
"savedCu": 8.5,
"savedTime": 15.5,
"benefitJobCount": 24,
"readInstanceList": [
"20251123081031234g8x2p2m"
],
"writeInstanceList": [
"20251123082031234g8x2p2m"
],
"alterTableSql": "ALTER TABLE order_detail CLUSTERED BY (customer_id) SORTED BY (customer_id) INTO 32 BUCKETS;",
"partitionScanList": [
"ds=20251123"
],
"applied": false
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.