元數據信息查詢
更新時間 2025-09-04 18:10:24
最近更新時間: 2025-09-04 18:10:24
分享文章
接口功能介紹
此接口提供查詢集群下指定表的元數據的功能,用戶輸入集群id、時間戳、Hive庫名、Hive表名,返回集群的該表的文件數、存儲大小、分區數等元數據。
接口約束
集群必須處于運行狀態。
URI
GET /v1/emr/doctor/openapi/meta/hive/tableInfo
路徑參數
無
Query參數
| 參數 | 是否必填 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|---|
| clusterId | 是 | String | 集群id | da595eb1d81503b323fdc01d9bf786b7 | |
| timestamp | 是 | Long | 要查詢的時間點,以 Unix 時間戳表示(單位:秒) | 1700000000 | |
| databaseName | 是 | String | Hive庫名 | test_db1 | |
| tableName | 是 | String | Hive表名 | test_table1 |
請求參數
請求頭header參數
無
請求體body參數
無
響應參數
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| statusCode | Integer | 狀態碼 | 200 | / |
| message | String | 用來簡述當前接口調用狀態以及必要提示信息 | success | / |
| error | String | 錯誤碼,請求成功時,不返回該字段 | EMR_400001 | / |
| returnObj | Object | 返回結果 | returnObj |
表 returnObj(請求成功)
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| clusterId | String | 集群的唯一標識符 | da595eb1d81503b323fdc01d9bf786b7 | |
| databaseName | String | 數據庫名稱 | test_db1 | |
| tableName | String | 表名稱 | test_table1 | |
| hivePath | String | Hive存儲路徑 | /hive/xxx/xxx/xx | |
| fileCnt | Long | 文件總數 | 100 | |
| storageCnt | Long | 總存儲量(單位:字節) | 204800 | |
| avgStorageCnt | Long | 平均每個文件的存儲量(單位:字節) | 2048 | |
| lastAccessTime | String | 最后訪問時間 | 2024-11-06 01:09:37 | |
| isExternalTable | Boolean | 是否為外部表 | false | |
| isMisDelete | Boolean | 是否誤刪除 | false | |
| isPartitionTable | Boolean | 是否為分區表 | true | |
| partitionCnt | Long | 分區數量 | 20 | |
| iceFileCnt | Long | 冰分區文件數量 | 1 | |
| iceStorageCnt | Long | 冰分區文件總存儲量(單位:字節) | 20 | |
| coldFileCnt | Long | 冷分區文件數量 | 1 | |
| coldStorageCnt | Long | 冷分區文件總存儲量(單位:字節) | 1024 | |
| emptyFilePtCnt | Long | 空白文件分區數 | 1 | |
| emptyFilePtFileCnt | Long | 空白文件分區文件數 | 2 | |
| smallFilePtCnt | Long | 小文件分區數量 | 5 | |
| smallFilePtFileCnt | Long | 小文件分區中的文件數量 | 5 |
表 returnObj(請求失敗)
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| timestamp | String | timestamp參數錯誤時返回該字段 | 時間戳不能為null | |
| databaseName | String | databaseName參數錯誤時返回該字段 | databaseName不能為null | |
| tableName | String | tableName參數錯誤時返回該字段 | tableName不能為null | |
| clusterId | String | clusterId參數錯誤時返回該字段 | 不能為空 |
枚舉參數
無
請求示例
請求url
//emr-global.ctapi.daliqc.cn/v1/emr/doctor/openapi/meta/hive/tableInfo?clusterId=cluster-12345×tamp=1700000000&databaseName=test_db1&tableName=test_table1
請求頭header
無
請求體body
無
響應示例
請求成功返回值示例
{
"statusCode": 200,
"message": "success",
"returnObj": {
"clusterId": "da595eb1d81503b323fdc01d9bf786b7",
"databaseName": "test_db1",
"tableName": "test_table1",
"hivePath": "/hive/xxx/xxx/xx",
"fileCnt": 100,
"storageCnt": 204800,
"avgStorageCnt": 2048,
"lastAccessTime": "2024-11-06 01:09:37",
"isExternalTable": false,
"isMisDelete": false,
"isPartitionTable": true,
"partitionCnt": 20,
"iceFileCnt": 1,
"iceStorageCnt": 20,
"coldFileCnt": 1,
"coldStorageCnt": 1024,
"emptyFilePtCnt": 1,
"emptyFilePtFileCnt": 2,
"smallFilePtCnt": 5,
"smallFilePtFileCnt": 5
}
}
請求失敗返回值示例
請求參數值無效示例1:
{
? "statusCode": 500,
? "error": "EMR_401002",
? "message": "請求參數值無效",
? "returnObj": {
? "timestamp": "timestamp應為長整型"
? }
}
請求參數值無效示例2:
{
? "statusCode": 500,
? "error": "EMR_401002",
? "message": "請求參數值無效",
? "returnObj": {
? "timestamp": "時間戳不能為null"
? }
}
請求參數值無效示例3:
{
? "statusCode": 500,
? "error": "EMR_401002",
? "message": "請求參數值無效",
? "returnObj": {
? "timestamp": "時間戳必須是正整數"
? }
}
請求參數值無效示例4:
{
? "statusCode": 500,
? "error": "EMR_401002",
? "message": "請求參數值無效",
? "returnObj": {
? "timestamp": "時間戳不在有效范圍內,請輸入不大于當前時間的時間戳(單位: 秒)"
? }
}
請求參數值無效示例5:
{
? "statusCode": 500,
? "error": "EMR_401002",
? "message": "請求參數值無效",
? "returnObj": {
? "databaseName": "databaseName不能為null",
? "tableName": "tableName不能為null"
? }
}
請求參數值無效示例6:
{
? "statusCode": 500,
? "error": "EMR_401002",
? "message": "請求參數值無效",
? "returnObj": {
? "timestamp": "時間戳不在有效范圍內,請輸入不大于當前時間的時間戳(單位: 秒)"
? }
}
請求參數無效示例7:
{
? "statusCode": 500,
? "error": "EMR_401002",
? "message": "請求參數值無效",
? "returnObj": {
? "clusterId": "不能為空"
? }
}
請求參數無效示例8:
{
? "statusCode": 500,
? "error": "EMR_401002",
? "message": "請求參數值無效",
? "returnObj": {
? "clusterId": "無效的集群id"
? }
}
集群狀態不合法示例:
{
? "statusCode": 500,
? "error": "EMR_401006",
? "message": "非運行中集群無法查看信息,當前的集群狀態為:啟動中",
? "returnObj": {}
}
集群不涉及元數據組件示例:
{
? "statusCode": 500,
? "error": "EMR_401014",
? "message": "集群不涉及元數據組件",
? "returnObj": {}
}
集群不屬于該用戶示例:
{
? "statusCode": 500,
? "error": "EMR_401004",
? "message": "非法操作",
? "returnObj": {}
}
該集群不存在示例:
{
? "statusCode": 500,
? "error": "EMR_401005",
? "message": "該集群不存在",
? "returnObj": {}
}
請求失敗示例:
{
? "statusCode": 500,
? "error": "EMR_400000",
? "message": "請求失敗",
? "returnObj": {}
}
狀態碼
請參考
錯誤碼
請參考