GetTable - 查询表信息

更新时间:
复制 MD 格式

获取表信息。

接口说明

  • 地域的公网接入地址: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:getTable

get

*全部资源

*

请求参数

名称

类型

必填

描述

示例值

DbName

string

数据库名。

dbName

TableName

string

查询表名。

tableName

DBClusterId

string

集群 ID。

amv-*******

RegionId

string

地域 ID。

cn-hangzhou

返回参数

名称

类型

描述

示例值

object

返回结果。

RequestId

string

请求 ID。

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

Code

integer

错误码。

0

Message

string

错误信息。

""

Success

boolean

是否成功。

true

Table TableModel

表详细信息。

示例

正常返回示例

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"
      }
    ],
    "CreatedBySource": "",
    "CreatedByUser": ""
  }
}

错误码

HTTP status code

错误码

错误信息

描述

400 MDS.IllegalArgument Invalid argument. 用户使用了非法参数
400 MDS.InvalidPrivilege No permissions. 用户无权限进行操作
400 MDS.MetaSchemaAlreadyExist The database already exists. 数据库已存在
400 MDS.MetaSchemaNotExist The database does not exist. 操作的数据库不存在
400 MDS.MetaTableAlreadyExist The table already exists. 操作的表已经存在
400 MDS.MetaTableNotExist The table is not found. 操作的表不存在
500 MDS.InternalError An internal MDS error occurred. MDS服务内部错误
500 MDS.MetaVisitError Failed to access metadata. 访问元数据失败
403 MDS.RamAuthAccessDenied ram auth access denied. RAM鉴权失败

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

变更历史

更多信息,参考变更详情