ListTables - 获取数据表列表

获取数据湖中数据表列表。

调试

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

授权信息

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

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

请求语法

GET /api/metastore/databases/tables/list HTTP/1.1

请求参数

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

数据目录 ID。

1344371
TableNamePatternstring

数据表名称,正则表达式匹配。

.*
NextPageTokenstring

翻页 token,从返回结果返回,无则传空字符串或''。

''
PageSizeinteger

每页大小。

10
DatabaseNamestring

数据库名称。

database_test
TableTypestring

数据表的类型,取值如下:

  • MANAGED_TABLE:内部表。

  • EXTERNAL_TABLE:外部表。

  • VIRTUAL_VIEW:虚拟视图。

  • INDEX_TABLE:索引表。

  • MATERIALIZED_VIEW:物化视图。

MANAGED_TABLE

返回参数

名称类型描述示例值
object

返回消息体。

Codestring

状态码。

OK
Messagestring

返回信息。

.
NextPageTokenstring

翻页 token。

2cb472ec1bf84f8d92f9c4baa0d21c19aa
RequestIdstring

请求 ID。

B7F4B621-E41E-4C84-B97F-42B5380A32BB
Successboolean

是否调用成功。取值如下:

  • true:调用成功。

  • false:调用失败。

true
Tablesarray

数据表列表。

Table

数据表详细信息。

Code:错误码说明。
InternalError:其他类型错误,请参考 Message 提示。

示例

正常返回示例

JSON格式

{
  "Code": "OK",
  "Message": ".",
  "NextPageToken": "2cb472ec1bf84f8d92f9c4baa0d21c19aa",
  "RequestId": "B7F4B621-E41E-4C84-B97F-42B5380A32BB",
  "Success": true,
  "Tables": [
    {
      "Cascade": false,
      "CreateTime": 1608707407,
      "CreatedBy": "zhangsan",
      "DatabaseName": "database_test",
      "LastAccessTime": 1608707407,
      "LastAnalyzedTime": 1608707407,
      "Owner": "zhangsan",
      "OwnerType": "USER",
      "Parameters": {
        "key": "key"
      },
      "PartitionKeys": [
        {
          "Comment": "comment_day",
          "Name": "day",
          "Parameters": {
            "key": "key"
          },
          "Type": "int"
        }
      ],
      "Privileges": {
        "GroupPrivileges": {
          "key": [
            {
              "CreateTime": 1606226844,
              "GrantOption": true,
              "Grantor": "Grantor",
              "GrantorType": "GrantorType",
              "Privilege": "Privilege"
            }
          ]
        },
        "RolePrivileges": {
          "key": [
            {
              "CreateTime": 1606226844,
              "GrantOption": true,
              "Grantor": "Grantor",
              "GrantorType": "GrantorType",
              "Privilege": "Privilege"
            }
          ]
        },
        "UserPrivileges": {
          "key": [
            {
              "CreateTime": 1606226844,
              "GrantOption": true,
              "Grantor": "Grantor",
              "GrantorType": "GrantorType",
              "Privilege": "Privilege"
            }
          ]
        }
      },
      "Retention": 30000,
      "RewriteEnabled": true,
      "Sd": {
        "BucketCols": [
          "2010"
        ],
        "Cols": [
          {
            "Comment": "comment_day",
            "Name": "day",
            "Parameters": {
              "key": "key"
            },
            "Type": "int"
          }
        ],
        "Compressed": false,
        "InputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat",
        "Location": "file:///tmp/table",
        "NumBuckets": 10,
        "OutputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat",
        "Parameters": {
          "key": "key"
        },
        "SerDeInfo": {
          "Name": "name",
          "SerializationLib": "org.apache.hadoop.hive.serde2.OpenCSVSerde"
        },
        "SkewedInfo": {
          "SkewedColNames": [
            "col1"
          ],
          "SkewedColValueLocationMaps": {
            "key": "{“col1”:\"val1\"}"
          },
          "SkewedColValues": [
            [
              "\"123\""
            ]
          ]
        },
        "SortCols": [
          {
            "Col": "col1",
            "Order": 1
          }
        ],
        "StoredAsSubDirectories": false
      },
      "TableName": "table_name",
      "TableType": "MANAGED_TABLE",
      "Temporary": false,
      "UpdateTime": 1608707407,
      "ViewExpandedText": "''",
      "ViewOriginalText": "''",
      "TableId": "59c6c8fefeaa46d8b599c1f790c59a19",
      "TableVersion": {
        "Table": {
          "Cascade": false,
          "CreateTime": 1608707407,
          "CreatedBy": "zhangsan",
          "DatabaseName": "database_test",
          "LastAccessTime": 1608707407,
          "LastAnalyzedTime": 1608707407,
          "Owner": "zhangsan",
          "OwnerType": "USER",
          "PartitionKeys": [
            {
              "Comment": "comment_day",
              "Name": "day",
              "Type": "int"
            }
          ],
          "Privileges": {},
          "Retention": 30000,
          "RewriteEnabled": true,
          "Sd": {
            "BucketCols": [
              "2010"
            ],
            "Cols": [],
            "Compressed": false,
            "InputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat",
            "Location": "file:///tmp/table",
            "NumBuckets": 10,
            "OutputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat",
            "Parameters": {
              "key": "key"
            },
            "SerDeInfo": {
              "Name": "name",
              "SerializationLib": "org.apache.hadoop.hive.serde2.OpenCSVSerde"
            },
            "SkewedInfo": {
              "SkewedColNames": [
                "col1"
              ],
              "SkewedColValueLocationMaps": {
                "key": "{“col1”:\"val1\"}"
              },
              "SkewedColValues": [
                [
                  "\"123\""
                ]
              ]
            },
            "SortCols": [
              {
                "Col": "col1",
                "Order": 1
              }
            ],
            "StoredAsSubDirectories": false
          },
          "TableName": "table_name",
          "TableType": "MANAGED_TABLE",
          "Temporary": false,
          "UpdateTime": 1608707407,
          "ViewExpandedText": "''",
          "ViewOriginalText": "''",
          "TableId": "59c6c8fefeaa46d8b599c1f790c59a19",
          "TableVersion": {
            "Table": {
              "Cascade": false,
              "CreateTime": 1608707407,
              "CreatedBy": "zhangsan",
              "DatabaseName": "database_test",
              "LastAccessTime": 1608707407,
              "LastAnalyzedTime": 1608707407,
              "Owner": "zhangsan",
              "OwnerType": "USER",
              "PartitionKeys": [],
              "Privileges": {},
              "Retention": 30000,
              "RewriteEnabled": true,
              "Sd": {
                "BucketCols": [
                  "2010"
                ],
                "Cols": [],
                "Compressed": false,
                "InputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat",
                "Location": "file:///tmp/table",
                "NumBuckets": 10,
                "OutputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat",
                "Parameters": {
                  "key": "key"
                },
                "SerDeInfo": {
                  "Name": "name",
                  "SerializationLib": "org.apache.hadoop.hive.serde2.OpenCSVSerde"
                },
                "SkewedInfo": {
                  "SkewedColNames": [
                    "col1"
                  ],
                  "SkewedColValueLocationMaps": {
                    "key": "{“col1”:\"val1\"}"
                  },
                  "SkewedColValues": [
                    [
                      "\"123\""
                    ]
                  ]
                },
                "SortCols": [
                  {
                    "Col": "col1",
                    "Order": 1
                  }
                ],
                "StoredAsSubDirectories": false
              },
              "TableName": "table_name",
              "TableType": "MANAGED_TABLE",
              "Temporary": false,
              "UpdateTime": 1608707407,
              "ViewExpandedText": "''",
              "ViewOriginalText": "''",
              "TableId": "59c6c8fefeaa46d8b599c1f790c59a19",
              "TableVersion": {
                "VersionId": 5
              }
            },
            "VersionId": 5
          }
        },
        "VersionId": 5
      }
    }
  ]
}

错误码

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

变更历史

变更时间变更内容概要操作
暂无变更历史