GetMetaTableFullInfo - 获取表的完整信息(包括字段信息)

更新时间:
复制 MD 格式

获取表的完整信息(包括字段信息)。

说明

目前该API接口已标记为弃用。

接口说明

仅支持获取 EMR 引擎表的信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称

类型

必填

描述

示例值

TableGuid

string

否

表的唯一标识。您可以通过调用 GetMetaDBTableList ,获取表的唯一标识。

odps.engine_name.table_name

PageNum

integer

否

请求获取的页码数,用于分页。

1

PageSize

integer

否

每页显示的条数,默认为 10 条,最大 100 条。

10

ClusterId

string

否

EMR 集群的 ID,仅当数据类型为 EMR 时,需要配置该参数。

您可以登录 EMR 的控制台,获取集群 ID。

C-010A704DA760****

DatabaseName

string

否

数据库的名称。仅当数据类型为 EMR 时,需要配置该参数。

您可以调用 ListMetaDB 接口获取。

abc

TableName

string

否

EMR 的表名称。仅当数据类型为 EMR 时,需要配置该参数。

您可以通过调用 GetMetaDBTableList 接口,获取表名称。

abc

DataSourceType

string

否

数据类型,当前仅支持取值为 EMR。

emr

返回参数

名称

类型

描述

示例值

object

返回的数据结构。

HttpStatusCode

integer

HTTP 状态码。

200

ErrorMessage

string

错误信息。

The specified parameters are invalid.

RequestId

string

请求 ID。用于定位日志,排查问题。

0bc1411515937****

Success

boolean

调用是否成功。

true

ErrorCode

string

错误码。

1031203110005

Data

object

业务数据。

TableName

string

表的名称。

table_name

Comment

string

表的备注信息。

comment

LifeCycle

integer

表的生命周期,单位为天。

5

CreateTime

integer

创建表的时间。该结果显示为时间戳,您可以根据使用的时区将时间戳转换为相应日期。

1589870293000

ProjectName

string

表所在工作空间的名称。

test

ProjectId

integer

表所在工作空间的 ID。

22

OwnerId

string

表所有者的 ID。

123

EnvType

integer

环境类型,取值如下:

  • 0 表示开发环境的表。

  • 1 表示生产环境的表。

1

LastAccessTime

integer

最后一次访问表的时间。该结果显示为时间戳,您可以根据使用的时区将时间戳转换为相应日期。

1589870294000

DataSize

integer

表占用的存储空间,单位为字节(B)。

10

LastModifyTime

integer

最后更新表的时间。该结果显示为时间戳,您可以根据使用的时区将时间戳转换为相应日期。

1589870294000

DatabaseName

string

数据库的名称。

abc

IsVisible

integer

表是否可见,取值如下:

  • 0 表示该表对工作空间成员可见。

  • 1 表示该表对租户内可见。

  • 2 表示该表在租户间均可见。

  • 3 表示该表仅对责任人可见。

1

TotalColumnCount

integer

字段的总数。

22

TableGuid

string

表的唯一标识。

odps.engine_name.table_name

PartitionKeys

string

分区键。

abc

LastDdlTime

integer

最后变更表结构的时间。该结果显示为时间戳,您可以根据使用的时区将时间戳转换为相应日期。

1589870294000

Location

string

Hive 表的存储地址。

hdfs://localhost:777/user/hadoop/test.txt

ClusterId

string

EMR 集群的 ID。

C-010A704DA760****

TenantId

integer

租户 ID。

12345

Schema

string

表 Schema 信息。

default

ColumnList

array<object>

字段列表。

object

返回的数据结构。

ColumnName

string

字段的名称。

1

ColumnGuid

string

字段的唯一标识。

odps.engine_name.table_name.1

IsPartitionColumn

boolean

字段是否为分区字段,取值如下:

  • true,是分区字段。

  • false,不是分区字段。

true

Comment

string

字段的备注。

comment

ColumnType

string

字段的类型。

string

IsPrimaryKey

boolean

字段是否为主键,取值如下:

  • true,是主键。

  • false,不是主键。

false

Position

integer

字段的排序。

1

Caption

string

字段的描述信息。

data comment

IsForeignKey

boolean

字段是否为外键,取值如下:

  • true,是外键。

  • false,不是外键。

true

示例

正常返回示例

JSON格式

{
  "HttpStatusCode": 200,
  "ErrorMessage": "The specified parameters are invalid.",
  "RequestId": "0bc1411515937****",
  "Success": true,
  "ErrorCode": "1031203110005",
  "Data": {
    "TableName": "table_name",
    "Comment": "comment",
    "LifeCycle": 5,
    "CreateTime": 1589870293000,
    "ProjectName": "test",
    "ProjectId": 22,
    "OwnerId": "123",
    "EnvType": 1,
    "LastAccessTime": 1589870294000,
    "DataSize": 10,
    "LastModifyTime": 1589870294000,
    "DatabaseName": "abc",
    "IsVisible": 1,
    "TotalColumnCount": 22,
    "TableGuid": "odps.engine_name.table_name",
    "PartitionKeys": "abc",
    "LastDdlTime": 1589870294000,
    "Location": "hdfs://localhost:777/user/hadoop/test.txt",
    "ClusterId": "C-010A704DA760****",
    "TenantId": 12345,
    "Schema": "default",
    "ColumnList": [
      {
        "ColumnName": "1",
        "ColumnGuid": "odps.engine_name.table_name.1",
        "IsPartitionColumn": true,
        "Comment": "comment",
        "ColumnType": "string",
        "IsPrimaryKey": false,
        "Position": 1,
        "Caption": "data comment",
        "IsForeignKey": true
      }
    ]
  }
}

错误码

HTTP status code

错误码

错误信息

描述

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.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.UserId.Missing 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.

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。