Available in VPC
Get the list of partitions in a table.
Request
This section describes the request format. The method and URI are as follows:
Method | URI |
---|---|
GET | /api/v1/catalogs/{catalogId}/databases/{databaseName}/tables/{tableName}/partitions |
Request headers
For information about the headers common to all Data Catalog APIs, see Data Catalog request headers.
Request path parameters
You can use the following path parameters with your request:
Field | Type | Required | Description |
---|---|---|---|
catalogId |
Integer | Required | Catalog ID
|
databaseName |
String | Required | Database name
|
tableName |
String | Required | Table name
|
Request query parameters
You can use the following query parameters with your request:
Field | Type | Required | Description |
---|---|---|---|
pageNo |
Integer | Optional | Page number
|
pageSize |
Integer | Optional | Page output count
|
Request example
The request example is as follows:
curl --location --request GET 'https://datacatalog.apigw.ntruss.com/api/v1/catalogs/4**/databases/log_database/tables/log_table_2/partitions?pageNo=1&pageSize=20' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'
Response
This section describes the response format.
Response body
The response body includes the following data:
Field | Type | Required | Description |
---|---|---|---|
pageNo |
Integer | - | Page number |
pageSize |
Integer | - | Page output count |
totalCount |
Integer | - | Number of response results |
requestId |
String | - | ID for the request
|
partitionList |
Array | - | Partition list |
partitionList
The following describes partitionList
.
Field | Type | Required | Description |
---|---|---|---|
partitionKey |
Object | - | Partition key information |
partitionKey.name |
String | - | Partition key name |
partitionValue |
Object | - | Partition value information |
partitionValue.valueList |
Array | - | Partition value list |
Response status codes
For response status codes common to all Data Catalog APIs, see Data Catalog response status codes.
Response example
The response example is as follows:
{
"pageNo": 1,
"pageSize": 20,
"totalCount": 6,
"requestId": "595f3abc-****-****-****-8c7053506eef",
"partitionList": [
{
"partitionKey": {
"name": "year"
},
"partitionValue": {
"valueList": [
"2022",
"2022",
"2022",
"2023",
"2023",
"2023"
]
}
},
{
"partitionKey": {
"name": "month"
},
"partitionValue": {
"valueList": [
"10",
"11",
"12",
"01",
"02",
"03"
]
}
}
]
}