接口功能介绍
此接口提供查询集群下指定表的元数据的功能,用户输入集群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
https://emr-global.ctapi.ctyun.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": {}
}
状态码
请参考 状态码
错误码
请参考 错误码