BatchCreatePartitions
為資料湖的資料表,批量新增多個分區。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
dlf:BatchCreatePartitions |
*All Resource
|
無 | 無 |
請求文法
POST /api/metastore/catalogs/databases/tables/partitions/batchcreate HTTP/1.1
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| Body |
object |
否 |
HTTP 請求體,均採用 JSON 格式。 |
|
| CatalogId |
string |
否 |
数据目录 ID。 |
1344371 |
| DatabaseName |
string |
否 |
数据库名称。 |
database_test |
| IfNotExists |
boolean |
否 |
如果相同名字的分区已经存在,是否忽略异常。 |
true |
| NeedResult |
boolean |
否 |
是否需要返回分区信息,为 true 时结果会返回 Partitions。 |
true |
| PartitionInputs |
array |
否 |
分区输入信息列表。 |
|
| PartitionInput |
否 |
分区输入信息。 |
||
| TableName |
string |
否 |
数据表名称。 |
test_table_20201223 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
返回消息体。 |
||
| Code |
string |
状态码描述。 |
OK |
| Message |
string |
返回信息。 |
. |
| PartitionErrors |
array |
错误信息列表。 |
|
|
PartitionError |
错误信息。 |
||
| Partitions |
array |
分区结果列表,NeedResult=true 时返回。 |
|
| Partition |
分区结果。 |
||
| RequestId |
string |
请求 ID。 |
B7F4B621-E41E-4C84-B97F-42B5380A32BB |
| Success |
boolean |
是否调用成功。取值如下:
|
true |
Code 錯誤碼說明:
-
InvalidObject:找不到對應的 Table 或 Database。
-
AlreadyExists:對應的分區已經存在。
-
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
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。