ListPartitionsByFilter
取得資料湖中資料表分區列表,按Filter條件查詢。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
dlf:ListPartitionsByFilter |
list |
*All Resource
|
無 | 無 |
請求文法
POST /api/metastore/catalogs/databases/tables/partitions/listbyfilter HTTP/1.1
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| Body |
object |
否 |
HTTP 請求體。 |
|
| CatalogId |
string |
否 |
資料目錄 ID。 |
1344371 |
| DatabaseName |
string |
否 |
資料庫名稱。 |
database_test |
| Filter |
string |
否 |
查詢條件運算式。 支援以下運算子:
|
ds>20201201 |
| NextPageToken |
string |
否 |
分頁權杖,用於取得下一頁資料。如果回應結果中沒有提供,則傳空字串("")或空字元('')。 |
'' |
| PageSize |
integer |
否 |
每頁大小,最大為 1000。 |
10 |
| TableName |
string |
否 |
資料表名。 |
test_table_20200715162543389 |
| IsShareSd |
boolean |
否 |
是否共用 partition 的 SD 中 column 資訊。取值如下:
|
true |
isShareSd:是否共用 partition 的 SD 中 column 資訊。在 listpartitions 回傳的 partitions 列表中,不同 partition 的 sd 中 column 相同的可能性比較高,因此開啟共用,可以降低網路傳輸的資料量,有助於提升效能。
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
回傳訊息體。 |
||
| Code |
string |
狀態碼。 |
OK |
| Message |
string |
回傳資訊。 |
. |
| NextPageToken |
string |
分頁權杖,用於取得下一頁資料。 |
2cb472ec1bf84f8d92f9c4baa0d21c19aa |
| 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": ".",
"NextPageToken": "2cb472ec1bf84f8d92f9c4baa0d21c19aa",
"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": "相对路径"
}
}
]
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。