文档

GetTable - 查询表信息

更新时间:

获取表信息。

接口说明

  • 地域的公网接入地址:adb.<region-id>.aliyuncs.com。示例:adb.cn-hangzhou.aliyuncs.com
  • 地域的 VPC 接入地址:adb-vpc.<region-id>.aliyuncs.com。示例:adb-vpc.cn-hangzhou.aliyuncs.com

调试

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

授权信息

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

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
adb:getTableget
  • 全部资源
    *

请求参数

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

数据库名。

dbName
TableNamestring

查询表名。

tableName
DBClusterIdstring

集群 ID。

amv-*******
RegionIdstring

地域 ID。

cn-hangzhou

返回参数

名称类型描述示例值
object

返回结果。

RequestIdstring

请求 ID。

1AD222E9-E606-4A42-BF6D-8A4442913CEF
Codelong

错误码。

0
Messagestring

错误信息。

""
Successboolean

是否成功。

true
TableTableModel

表详细信息。

示例

正常返回示例

JSON格式

{
  "RequestId": "1AD222E9-E606-4A42-BF6D-8A4442913CEF",
  "Code": 0,
  "Message": "\"\"",
  "Success": true,
  "Table": {
    "TblId": 123,
    "DbName": "example",
    "TableName": "tableName",
    "TableType": "external_table",
    "PartitionKeys": [
      {
        "Name": "name",
        "Type": "long",
        "Comment": "comment",
        "DatabaseName": "databaseName",
        "TableName": "tableName",
        "MappedName": "mappedName",
        "DataType": "long",
        "CreateTime": "2023-01-05 13:17:55",
        "UpdateTime": "2023-01-05 13:17:55",
        "PkPosition": -1,
        "IsPartitionKey": false,
        "OrdinalPosition": -1,
        "ColumnRawName": "ColumnRawName",
        "PhysicalColumnName": "PhysicalColumnName",
        "Nullable": true,
        "AutoIncrement": true,
        "Precision": 1,
        "Scale": 1,
        "Primarykey": true,
        "DefaultValue": "default",
        "Tokenizer": "tokenizer",
        "Encode": "encode",
        "Compression": "compression",
        "Delimiter": "delimiter",
        "ValueType": "valueType",
        "CompressFloatUseShort": false,
        "OnUpdate": "onUpdate"
      }
    ],
    "Parameters": {
      "key": "key:value"
    },
    "Sd": {
      "SdId": 1,
      "Location": "oss://**************",
      "InputFormat": "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat",
      "OutputFormat": "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat",
      "Compressed": false,
      "NumBuckets": 1,
      "SerDeInfo": {
        "SerDeId": 123,
        "Name": "example",
        "Parameters": {
          "key": "key:value"
        },
        "SerializationLib": "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe"
      },
      "Parameters": {
        "key": "key:value"
      },
      "StoredAsSubDirectories": false
    },
    "CreateTime": "2023-01-05 13:17:55",
    "ViewOriginalText": "ViewOriginalText",
    "ViewExpandedText": "ViewExpandedText",
    "Temporary": false,
    "Comment": "description",
    "Cols": [
      {
        "Name": "name",
        "Type": "long",
        "Comment": "comment",
        "DatabaseName": "databaseName",
        "TableName": "tableName",
        "MappedName": "mappedName",
        "DataType": "long",
        "CreateTime": "2023-01-05 13:17:55",
        "UpdateTime": "2023-01-05 13:17:55",
        "PkPosition": -1,
        "IsPartitionKey": false,
        "OrdinalPosition": -1,
        "ColumnRawName": "ColumnRawName",
        "PhysicalColumnName": "PhysicalColumnName",
        "Nullable": true,
        "AutoIncrement": true,
        "Precision": 1,
        "Scale": 1,
        "Primarykey": true,
        "DefaultValue": "default",
        "Tokenizer": "tokenizer",
        "Encode": "encode",
        "Compression": "compression",
        "Delimiter": "delimiter",
        "ValueType": "valueType",
        "CompressFloatUseShort": false,
        "OnUpdate": "onUpdate"
      }
    ],
    "DistributeColumns": [
      {
        "Name": "name",
        "Type": "long",
        "Comment": "comment",
        "DatabaseName": "databaseName",
        "TableName": "tableName",
        "MappedName": "mappedName",
        "DataType": "long",
        "CreateTime": "2023-01-05 13:17:55",
        "UpdateTime": "2023-01-05 13:17:55",
        "PkPosition": -1,
        "IsPartitionKey": false,
        "OrdinalPosition": -1,
        "ColumnRawName": "ColumnRawName",
        "PhysicalColumnName": "PhysicalColumnName",
        "Nullable": true,
        "AutoIncrement": true,
        "Precision": 1,
        "Scale": 1,
        "Primarykey": true,
        "DefaultValue": "default",
        "Tokenizer": "tokenizer",
        "Encode": "encode",
        "Compression": "compression",
        "Delimiter": "delimiter",
        "ValueType": "valueType",
        "CompressFloatUseShort": false,
        "OnUpdate": "onUpdate"
      }
    ],
    "PhysicalTableName": "physicalTableName",
    "PhysicalDatabaseName": "physicalDatabaseName",
    "DistributeType": "DistributeType",
    "PartitionType": "PartitionType",
    "PartitionColumn": "colName",
    "PartitionCount": 16,
    "PreviousVersion": 1,
    "CurrentVersion": 2,
    "UpdateTime": "2023-01-05 13:17:55",
    "TableEngineName": "hive",
    "IsAllIndex": true,
    "BlockSize": 64,
    "Compression": "Compression",
    "RawTableName": "RawTableName",
    "SubpartitionType": "SubpartitionColumn",
    "SubpartitionColumn": "SubpartitionColumn",
    "SubpartitionCount": 64,
    "ArchiveType": "ArchiveType",
    "MaxColumnId": 0,
    "EnableDfs": false,
    "StoragePolicy": "StoragePolicy",
    "HotPartitionCount": 32,
    "IsFulltextDict": false,
    "RtIndexAll": false,
    "RouteColumns": [],
    "RtEngineType": "RtEngineType",
    "RtModeType": "RtModeType",
    "RouteType": "routeType",
    "DictEncode": false,
    "BucketCount": 16,
    "Bucket": 16,
    "ViewSecurityMode": "ViewSecurityMode",
    "Indexes": [
      {
        "DatabaseName": "exampleDatabase",
        "PhysicalTableName": "physicalDatabase",
        "IndexName": "indexName",
        "IndexType": "NORMAL",
        "IndexColumns": [],
        "ColumnOrds": [
          "ASC/DESC"
        ],
        "Options": {
          "key": "key:value"
        },
        "CreateTime": "2023-01-05 13:17:55",
        "UpdateTime": "2023-01-05 13:17:55"
      }
    ]
  }
}

错误码

HTTP status code错误码错误信息描述
400MDS.IllegalArgumentInvalid argument.用户使用了非法参数
400MDS.InvalidPrivilegeNo permissions.用户无权限进行操作
400MDS.MetaSchemaAlreadyExistThe database already exists.数据库已存在
400MDS.MetaSchemaNotExistThe database does not exist.操作的数据库不存在
400MDS.MetaTableAlreadyExistThe table already exists.操作的表已经存在
400MDS.MetaTableNotExistThe table is not found.操作的表不存在
500MDS.InternalErrorAn internal MDS error occurred.MDS服务内部错误
500MDS.MetaVisitErrorFailed to access metadata.访问元数据失败

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

变更历史

变更时间变更内容概要操作
2024-06-18OpenAPI 去除了 deprecated 标记、OpenAPI 错误码发生变更查看变更详情
2023-12-21OpenAPI 错误码发生变更查看变更详情
2023-10-19OpenAPI 变更为 deprecated,即将下线、OpenAPI 错误码发生变更查看变更详情
2023-03-22OpenAPI 错误码发生变更查看变更详情