批量获取数据湖中数据库分区详情。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
dlf:BatchGetPartitions |
get |
*全部资源
|
无 | 无 |
请求语法
POST /api/metastore/catalogs/databases/tables/partitions/batchget HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Body |
object |
否 |
HTTP 请求体(HTTP BODY)内容,均采用 JSON 格式。 |
|
| CatalogId |
string |
否 |
数据目录 ID。 |
1344371 |
| DatabaseName |
string |
否 |
数据库名称。 |
database_test |
| PartitionValueList | PartitionValueList |
否 |
分区值列表。 |
|
| TableName |
string |
否 |
数据表名称。 |
test_table_20200715162543389 |
| IsShareSd |
boolean |
否 |
是否共享 partition 的 SD 中 column 信息。 |
true |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回结果体。 |
||
| Code |
string |
状态码描述。 |
OK |
| Message |
string |
返回信息。 |
. |
| PartitionErrors |
array |
错误信息列表。 |
|
|
PartitionError |
错误信息。 |
||
| Partitions |
array |
分区详情列表。 |
|
| Partition |
分区详情。 |
||
| RequestId |
string |
请求 ID。 |
B7F4B621-E41E-4C84-B97F-42B5380A32BB |
| Success |
boolean |
是否调用成功。取值如下:
|
true |
| PartitionSpecs |
array |
分区规格列表。 |
|
| PartitionSpec |
分区规格。 |
Code 错误码说明:
-
NoSuchObject:对应的数据库、数据表不存在。
-
InternalError:其他类型错误,请参考 Message 提示。
示例
正常返回示例
JSON格式
{
"Code": "OK",
"Message": ".",
"PartitionErrors": [
{
"ErrorDetail": {
"Code": "401",
"Message": "auth failed"
},
"PartitionValues": [
"2010"
]
}
],
"Partitions": [
{
"CreateTime": 1608730999,
"DatabaseName": "database_test",
"LastAccessTime": 1608730999,
"LastAnalyzedTime": 1608730999,
"Parameters": {
"key": "key"
},
"Privileges": {
"GroupPrivileges": {
"key": [
{
"CreateTime": 1606226844,
"GrantOption": true,
"Grantor": "Grantor",
"GrantorType": "GrantorType",
"Privilege": "Privilege"
}
]
},
"RolePrivileges": {
"key": [
{
"CreateTime": 1606226844,
"GrantOption": true,
"Grantor": "Grantor",
"GrantorType": "GrantorType",
"Privilege": "Privilege"
}
]
},
"UserPrivileges": {
"key": [
{
"CreateTime": 1606226844,
"GrantOption": true,
"Grantor": "Grantor",
"GrantorType": "GrantorType",
"Privilege": "Privilege"
}
]
}
},
"Sd": {
"BucketCols": [
"2010"
],
"Cols": [
{
"Comment": "comment_day",
"Name": "day",
"Parameters": {
"key": "key"
},
"Type": "int"
}
],
"Compressed": false,
"InputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat",
"Location": "file:///tmp/table",
"NumBuckets": 10,
"OutputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat",
"Parameters": {
"key": "key"
},
"SerDeInfo": {
"Name": "name",
"Parameters": {
"key": "key"
},
"SerializationLib": "org.apache.hadoop.hive.serde2.OpenCSVSerde"
},
"SkewedInfo": {
"SkewedColNames": [
"col1"
],
"SkewedColValueLocationMaps": {
"key": "{“col1”:\"val1\"}"
},
"SkewedColValues": [
[
"\"123\""
]
]
},
"SortCols": [
{
"Col": "col1",
"Order": 1
}
],
"StoredAsSubDirectories": false
},
"TableName": "test_table_20201223",
"Values": [
"part1"
]
}
],
"RequestId": "B7F4B621-E41E-4C84-B97F-42B5380A32BB",
"Success": true,
"PartitionSpecs": [
{
"SharedSDPartitions": [
{
"CreateTime": 1608730999,
"DatabaseName": "database_test",
"LastAccessTime": 1608730999,
"LastAnalyzedTime": 1608730999,
"Parameters": {
"key": "key"
},
"Privileges": {},
"Sd": {
"BucketCols": [
"2010"
],
"Cols": [
{
"Comment": "comment_day",
"Name": "day",
"Parameters": {
"key": "key"
},
"Type": "int"
}
],
"Compressed": false,
"InputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat",
"Location": "file:///tmp/table",
"NumBuckets": 10,
"OutputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat",
"Parameters": {
"key": "key"
},
"SerDeInfo": {
"Name": "name",
"SerializationLib": "org.apache.hadoop.hive.serde2.OpenCSVSerde"
},
"SkewedInfo": {
"SkewedColNames": [
"col1"
],
"SkewedColValueLocationMaps": {
"key": "{“col1”:\"val1\"}"
},
"SkewedColValues": [
[
"\"123\""
]
]
},
"SortCols": [
{
"Col": "col1",
"Order": 1
}
],
"StoredAsSubDirectories": false
},
"TableName": "test_table_20201223",
"Values": [
"part1"
]
}
],
"SharedStorageDescriptor": {
"Cols": [
{
"Comment": "comment_day",
"Name": "day",
"Type": "int"
}
],
"Location": "相对路径"
}
}
]
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。