该接口用于获取表的基础信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
dataworks:* |
get |
*全部资源
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| TableGuid |
string |
否 |
MaxCompute 表的唯一标识。格式为 odps.projectName.tableName。 说明
EMR 场景下,该参数非必选。 |
odps.engine_name.table_name |
| ClusterId |
string |
否 |
EMR 集群的 ID,当 DataSourceType(数据类型)参数配置为 EMR 时,当前参数必配。 您可以登录 EMR 的控制台,获取集群 ID。 |
abc |
| DatabaseName |
string |
否 |
数据库的名称。仅当数据类型为 EMR 时,需要配置该参数。 您可以调用 ListMetaDB 接口获取。 |
abc |
| TableName |
string |
否 |
EMR 的表名称。仅当数据类型为 EMR 时,需要配置该参数。 您可以通过调用 GetMetaDBTableList 接口,获取表名称。 |
abc |
| DataSourceType |
string |
否 |
数据类型,包括 odps 和 emr。 |
emr |
| Extension |
boolean |
否 |
是否包含扩展字段。 扩展字段包含读取次数、收藏次数、浏览次数等。 仅当数据类型为 ODPS 时,该参数生效。 |
false |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回结果。 |
||
| HttpStatusCode |
integer |
请求返回码。 |
200 |
| ErrorMessage |
string |
错误信息。 |
The connection does not exist. |
| RequestId |
string |
请求 ID。 |
0bc1411515937 |
| Success |
boolean |
请求是否成功。 |
true |
| ErrorCode |
string |
错误码。 |
Invalid.Tenant.ConnectionNotExists |
| Data |
object |
业务数据。 |
|
| TableName |
string |
表的名称。 |
table_name |
| FavoriteCount |
integer |
表的收藏次数。仅当 Extension 参数取值为 true 时才会返回该参数,并且该参数仅对 odps 数据类型生效。 |
6 |
| Comment |
string |
表的描述。 |
test table |
| ColumnCount |
integer |
字段的个数。 |
3 |
| CreateTime |
integer |
创建表的时间。 |
1589870294000 |
| ProjectId |
integer |
工作空间的 ID。 |
232 |
| OwnerId |
string |
表所有者的 ID。 |
123 |
| EnvType |
integer |
环境类型,取值如下:
|
1 |
| DatabaseName |
string |
数据库的名称。 |
abc |
| IsVisible |
integer |
表的可见性:
|
1 |
| TableGuid |
string |
表的唯一标识。 |
odps.engine_name.table_name |
| ReadCount |
integer |
表的读取次数。仅当 Extension 参数取值为 true 时才会返回该参数,并且该参数仅对 odps 数据类型生效。 |
3 |
| ClusterId |
string |
EMR 集群的 ID。 |
abc |
| IsPartitionTable |
boolean |
是否为分区表,取值如下:
|
true |
| IsView |
boolean |
是否为视图,取值如下:
|
false |
| LifeCycle |
integer |
表的生命周期。单位为天。 说明
MaxCompute 表未设置生命周期时,返回值为 0,表示永久有效 |
5 |
| ProjectName |
string |
工作空间的名称。 |
test |
| ViewCount |
integer |
表的浏览次数。仅当 Extension 参数取值为 true 时才会返回该参数,并且该参数仅对 odps 数据类型生效。 |
2 |
| LastAccessTime |
integer |
最近一次访问表的时间。 |
1589870294000 |
| DataSize |
integer |
表占用的存储空间。单位为 Byte。 |
10 |
| LastModifyTime |
integer |
最近一次更新表的时间。 |
1589870294000 |
| LastDdlTime |
integer |
最近一次变更表结构的时间。 |
1589870294000 |
| PartitionKeys |
string |
Hive 分区。 |
ab |
| Location |
string |
Hive 数据库的存储地址。 |
hdfs:// |
| Caption |
string |
表的中文名称。 |
中文名 |
| TenantId |
integer |
租户 ID。 |
12345 |
| Schema |
string |
表 Schema 信息。在 ODPS,用户启动了三层模型需要填写 Schema 信息 |
default |
示例
正常返回示例
JSON格式
{
"HttpStatusCode": 200,
"ErrorMessage": "The connection does not exist.",
"RequestId": "0bc1411515937",
"Success": true,
"ErrorCode": "Invalid.Tenant.ConnectionNotExists",
"Data": {
"TableName": "table_name",
"FavoriteCount": 6,
"Comment": "test table",
"ColumnCount": 3,
"CreateTime": 1589870294000,
"ProjectId": 232,
"OwnerId": "123",
"EnvType": 1,
"DatabaseName": "abc",
"IsVisible": 1,
"TableGuid": "odps.engine_name.table_name",
"ReadCount": 3,
"ClusterId": "abc",
"IsPartitionTable": true,
"IsView": false,
"LifeCycle": 5,
"ProjectName": "test",
"ViewCount": 2,
"LastAccessTime": 1589870294000,
"DataSize": 10,
"LastModifyTime": 1589870294000,
"LastDdlTime": 1589870294000,
"PartitionKeys": "ab",
"Location": "hdfs://",
"Caption": "中文名",
"TenantId": 12345,
"Schema": "default"
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | Invalid.Meta.TableNotExist | The table does not exist. | 表不存在。 |
| 400 | InvalidParameter.Meta.CommonError | The specified parameter is invalid. | 请求参数错误。 |
| 400 | InvalidParameter.Meta.Illegal | The app guid parameter is invalid. | App参数错误。 |
| 400 | InvalidParameter.Meta.IllegalDate | The date format is invalid. | 日期格式错误。 |
| 400 | InvalidParameter.Meta.IllegalPageError | The parameter for paging is invalid. | 分页信息错误。 |
| 400 | InvalidParameter.Meta.NotExist | The object does not exist. | |
| 400 | InternalError.UserId.Missing | An internal system error occurred. Try again later. | |
| 400 | InternalError.Meta.NoCalcEngine | An error occurred while retrieving the compute engine based on the MaxCompute project. | 用户输入的 project 不正确 |
| 500 | InternalError.System | An internal system error occurred. Try again later. | |
| 500 | InternalError.Meta.TenantTimeOut | Failed to connect to the interface network. | 接口网络不通。 |
| 500 | InternalError.Meta.Unknown | An unknown error occurred while processing your request. | 未知错误。 |
| 403 | Forbidden.Meta.NoTenant | The user is not the owner of any tenants. | 当前的用户不是任何租户的所有者。 |
| 403 | Forbidden.Access | Access is forbidden. Please first activate DataWorks Enterprise Edition or Flagship Edition. | 没有权限,请授权 |
| 429 | Throttling.Api | The request for this resource has exceeded your available limit. | |
| 429 | Throttling.Api.Risk | The request for this resource has exceeded your daily available limit. | |
| 429 | Throttling.System | The DataWorks system is busy. Try again later. | |
| 429 | Throttling.User | Your request is too frequent. Try again later. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。