GetMmsTable - 获取MMA数据源内的某张表

更新时间:2025-04-24 09:37:52

获取MMA数据源内的某张表

调试

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

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用前面加 * 表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
操作访问级别资源类型条件关键字关联操作
odps:GetMmsTableget
*project
acs:odps:{#regionId}:{#accountId}:mmsdatasource/{#sourceId}

请求语法

GET /api/v1/mms/datasources/{sourceId}/tables/{tableId} HTTP/1.1

请求参数

名称类型必填描述示例值
名称类型必填描述示例值
sourceIdlong

数据源 ID

12323
tableIdlong

表 ID

22

返回参数

名称类型描述示例值
名称类型描述示例值
object

ApiRes

requestIdstring

请求 ID

E7FB14F1-4ACD-5C73-A755-B302D70AB9AD
dataobject

返回数据

idlong

table ID

22
dbIdlong

库 ID

3
dbNamestring

库名

mms_test
namestring

表名

test
typestring

表类型

MANAGED_TABLED
hasPartitionsboolean

是否是分区表

true
schemaobject

表结构

namestring

表名

test
commentstring

表注释

for mms test
columnsarray<object>

所有普通列

columnobject

普通列

namestring

列名

user_id
typestring

列类型

bigint
commentstring

列注释

user id
defaultValuestring

列默认值

10
nullableboolean

列是否可以为 null

false
partitionsarray<object>

所有分区列

partitionobject

分区列

namestring

列名

p1
typestring

列类型

string
commentstring

列注释

first partition level
defaultValuestring

列默认值

abc
nullableboolean

列是否为空

false
ownerstring

表 owner

Hive
locationstring

表存储位置

| hdfs://master-1-1.c-c127cd184bb029ea.cn-zhangjiakou.emr.aliyuncs.com:9000/user/hive/warehouse/demo
inputFormatstring

inputFormat

org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat
outputFormatstring

outputFormat

org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat
serdestring

serde

org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe
extrastring

以 JSON 格式存储的其他信息

{"mapkey.delim":":","collection.delim":",","serialization.format":"|","field.delim":"|"}
partitionsinteger

分区数

100
partitionsDoinginteger

正在迁移的分区数量

20
partitionsDoneinteger

迁移完成的分区数量

80
partitionsFailedinteger

迁移失败的分区数量

0
sourceIdlong

数据源 ID

2000028
sourceNamestring

数据源名

demo
sizelong

数据大小-以 Bytes 为单位

23232
numRowslong

行数

233232
updatedboolean

元数据是否有更新

false
lastDdlTimestring

lastDdlTime

2024-12-17 15:44:42
statusstring

迁移状态

枚举值:
  • PART_DONE部分迁移成功
  • INIT未迁移
  • DONE迁移成功
  • DOING迁移中
  • FAILED迁移失败
DONE

示例

正常返回示例

JSON格式

{
  "requestId": "E7FB14F1-4ACD-5C73-A755-B302D70AB9AD\n",
  "data": {
    "id": 22,
    "dbId": 3,
    "dbName": "mms_test",
    "name": "test",
    "type": "MANAGED_TABLED",
    "hasPartitions": true,
    "schema": {
      "name": "test",
      "comment": "for mms test",
      "columns": [
        {
          "name": "user_id",
          "type": "bigint",
          "comment": "user id",
          "defaultValue": 10,
          "nullable": false
        }
      ],
      "partitions": [
        {
          "name": "p1",
          "type": "string",
          "comment": "first partition level",
          "defaultValue": "abc",
          "nullable": false
        }
      ]
    },
    "owner": "Hive\n",
    "location": "| hdfs://master-1-1.c-c127cd184bb029ea.cn-zhangjiakou.emr.aliyuncs.com:9000/user/hive/warehouse/demo\n",
    "inputFormat": "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat \n",
    "outputFormat": "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat\n",
    "serde": "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe\n",
    "extra": {
      "mapkey.delim": ":",
      "collection.delim": ",",
      "serialization.format": "|",
      "field.delim": "|"
    },
    "partitions": 100,
    "partitionsDoing": 20,
    "partitionsDone": 80,
    "partitionsFailed": 0,
    "sourceId": 2000028,
    "sourceName": "demo",
    "size": 23232,
    "numRows": 233232,
    "updated": false,
    "lastDdlTime": "2024-12-17 15:44:42\n",
    "status": "DONE"
  }
}

错误码

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

  • 本页导读 (1)
  • 调试
  • 授权信息
  • 请求语法
  • 请求参数
  • 返回参数
  • 示例
  • 错误码
AI助理

点击开启售前

在线咨询服务

你好,我是AI助理

可以解答问题、推荐解决方案等