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暂无授权信息透出。

请求参数

名称

类型

必填

描述

示例值

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": 1,
    "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": "XIHE",
    "CreatedByUser": "example_user"
  }
}

错误码

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鉴权失败

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

变更历史

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