调用GetMetaTableBasicInfo获取表的基础信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetMetaTableBasicInfo |
系统规定参数。取值:GetMetaTableBasicInfo。 |
TableGuid | String | 是 | odps.engine_name.table_name |
MaxCompute表的唯一标识。格式为odps.projectName.tableName。 |
ClusterId | String | 否 | abc |
EMR集群的ID,仅当数据类型为EMR时,需要配置该参数。 您可以登录EMR的控制台,获取集群ID。 |
DatabaseName | String | 否 | abc |
数据库的名称。仅当数据类型为EMR时,需要配置该参数。 您可以调用ListMetaDB接口获取。 |
TableName | String | 否 | abc |
EMR的表名称。仅当数据类型为EMR时,需要配置该参数。 您可以通过调用GetMetaDBTableList接口,获取表名称。 |
DataSourceType | String | 否 | emr |
数据类型,包括odps和emr。 |
Extension | Boolean | 否 | false |
是否包含扩展字段。 扩展字段包含读取次数、收藏次数、浏览次数等。 仅当数据类型为ODPS时,该参数生效。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
HttpStatusCode | Integer | 200 |
HTTP状态码。 |
ErrorMessage | String | The connection does not exist. |
错误信息。 |
RequestId | String | 0bc1411515937 |
请求ID。 |
Success | Boolean | true |
请求是否成功。 |
ErrorCode | String | Invalid.Tenant.ConnectionNotExists |
错误码。 |
Data | Object |
业务数据。 |
|
TableName | String | table_name |
表的名称。 |
FavoriteCount | Long | 6 |
表的收藏次数。仅当Extension参数取值为true时才会返回该参数,并且该参数仅对odps数据类型生效。 |
Comment | String | test table |
表的描述。 |
ColumnCount | Integer | 3 |
字段的个数。 |
CreateTime | Long | 1589870294000 |
创建表的时间。 |
ProjectId | Long | 232 |
工作空间的ID。 |
OwnerId | String | 123 |
表所有者的ID。 |
EnvType | Integer | 1 |
环境类型,取值如下:
|
DatabaseName | String | abc |
数据库的名称。 |
IsVisible | Integer | 1 |
表的可见性:
|
TableGuid | String | odps.engine_name.table_name |
表的唯一标识。 |
ReadCount | Long | 3 |
表的读取次数。仅当Extension参数取值为true时才会返回该参数,并且该参数仅对odps数据类型生效。 |
ClusterId | String | abc |
EMR集群的ID。 |
IsPartitionTable | Boolean | true |
是否为分区表,取值如下:
|
IsView | Boolean | false |
是否为视图,取值如下:
|
LifeCycle | Integer | 5 |
表的生命周期。单位为天。 |
ProjectName | String | test |
工作空间的名称。 |
ViewCount | Long | 2 |
表的浏览次数。仅当Extension参数取值为true时才会返回该参数,并且该参数仅对odps数据类型生效。 |
LastAccessTime | Long | 1589870294000 |
最近一次访问表的时间。 |
DataSize | Long | 10 |
表占用的存储空间。单位为Byte。 |
LastModifyTime | Long | 1589870294000 |
最近一次更新表的时间。 |
LastDdlTime | Long | 1589870294000 |
最近一次变更表结构的时间。 |
PartitionKeys | String | ab |
Hive分区。 |
Location | String | hdfs:// |
Hive数据库的存储地址。 |
Caption | String | 中文名 |
表的中文名称。 |
TenantId | Long | 12345 |
租户ID。 |
Schema | String | default |
表Schema信息。在ODPS,用户启动了三层模型需要填写Schema信息 |
示例
请求示例
http(s)://[Endpoint]/?Action=GetMetaTableBasicInfo
&TableGuid=odps.engine_name.table_name
&ClusterId=abc
&DatabaseName=abc
&TableName=abc
&DataSourceType=emr
&Extension=false
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<GetMetaTableBasicInfoResponse>
<HttpStatusCode>200</HttpStatusCode>
<ErrorMessage>The connection does not exist.</ErrorMessage>
<RequestId>0bc1411515937</RequestId>
<Success>true</Success>
<ErrorCode>Invalid.Tenant.ConnectionNotExists</ErrorCode>
<Data>
<TableName>table_name</TableName>
<FavoriteCount>6</FavoriteCount>
<Comment>test table</Comment>
<ColumnCount>3</ColumnCount>
<CreateTime>1589870294000</CreateTime>
<ProjectId>232</ProjectId>
<OwnerId>123</OwnerId>
<EnvType>1</EnvType>
<DatabaseName>abc</DatabaseName>
<IsVisible>1</IsVisible>
<TableGuid>odps.engine_name.table_name</TableGuid>
<ReadCount>3</ReadCount>
<ClusterId>abc</ClusterId>
<IsPartitionTable>true</IsPartitionTable>
<IsView>false</IsView>
<LifeCycle>5</LifeCycle>
<ProjectName>test</ProjectName>
<ViewCount>2</ViewCount>
<LastAccessTime>1589870294000</LastAccessTime>
<DataSize>10</DataSize>
<LastModifyTime>1589870294000</LastModifyTime>
<LastDdlTime>1589870294000</LastDdlTime>
<PartitionKeys>ab</PartitionKeys>
<Location>hdfs://</Location>
<Caption>中文名</Caption>
<TenantId>12345</TenantId>
<Schema>default</Schema>
</Data>
</GetMetaTableBasicInfoResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/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"
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
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. | 根据ODPS项目获取计算引擎失败。 |
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. | 您被限制访问,请开通DataWorks企业版或旗舰版。 |
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. | DataWorks系统繁忙,请稍后再试。 |
429 | Throttling.User | Your request is too frequent. Try again later. | 您的请求过于频繁,请尝试放缓请求速度。 |
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. | 未知错误。 |
访问错误中心查看更多错误码。
GetMetaTableBasicInfo接口的使用示例Demo请参见DataWorks OpenAPI示例。